From 13fc751525f5069cf8fd21231fb1b2ce0cb50137 Mon Sep 17 00:00:00 2001 From: Gosha Date: Mon, 9 Dec 2024 10:03:04 +0200 Subject: [PATCH] fix(api): default priority --- .../extract-default-values-from-schema.usecase.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/api/src/app/workflows-v2/usecases/extract-default-values-from-schema/extract-default-values-from-schema.usecase.ts b/apps/api/src/app/workflows-v2/usecases/extract-default-values-from-schema/extract-default-values-from-schema.usecase.ts index d7b0fe272c2..36c11748105 100644 --- a/apps/api/src/app/workflows-v2/usecases/extract-default-values-from-schema/extract-default-values-from-schema.usecase.ts +++ b/apps/api/src/app/workflows-v2/usecases/extract-default-values-from-schema/extract-default-values-from-schema.usecase.ts @@ -64,6 +64,10 @@ export class ExtractDefaultValuesFromSchemaUsecase { private getValue(value: JSONSchemaDto, key: string) { const normalizedKey = key.toLowerCase().trim(); + if (value.default != null) { + return value.default; + } + if (normalizedKey.includes('url')) { return 'https://www.example.com/search?query=placeholder'; } @@ -72,10 +76,6 @@ export class ExtractDefaultValuesFromSchemaUsecase { return JSON.stringify(DEFAULT_PREVIEW_ISSUE_MESSAGE); } - if (value.default != null) { - return value.default; - } - return PreviewIssueEnum.PREVIEW_ISSUE_REQUIRED_CONTROL_VALUE_IS_MISSING; } }