Fix send email error when empty connected account (#10005)

- Fix send email error when empty connected account
- Add a global util to valid uuid
- Add an util to check if object is workflow related
This commit is contained in:
Thomas Trompette
2025-02-04 17:13:29 +01:00
committed by GitHub
parent 0113e40399
commit 7dfb9dd77f
12 changed files with 39 additions and 34 deletions

View File

@ -1,15 +1,12 @@
import { isValidUuid } from 'twenty-shared';
import {
WorkspaceQueryRunnerException,
WorkspaceQueryRunnerExceptionCode,
} from 'src/engine/api/graphql/workspace-query-runner/workspace-query-runner.exception';
export const assertIsValidUuid = (value: string) => {
const isValid =
/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(
value,
);
if (!isValid) {
if (!isValidUuid(value)) {
throw new WorkspaceQueryRunnerException(
`Value "${value}" is not a valid UUID`,
WorkspaceQueryRunnerExceptionCode.INVALID_QUERY_INPUT,