From 8a76cbe248cab1219f858f8f6799009686f6bbbe Mon Sep 17 00:00:00 2001 From: Aman Kumar Date: Wed, 25 Sep 2024 18:24:15 +0530 Subject: [PATCH] fix: duplicate project error issue --- .../contentstack-variants/src/utils/error-helper.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/contentstack-variants/src/utils/error-helper.ts b/packages/contentstack-variants/src/utils/error-helper.ts index 746b8b0d3d..58c087fbbc 100644 --- a/packages/contentstack-variants/src/utils/error-helper.ts +++ b/packages/contentstack-variants/src/utils/error-helper.ts @@ -9,18 +9,18 @@ export function formatErrors(errors: any): string { for (const errorKey in errors) { const errorValue = errors[errorKey]; if (Array.isArray(errorValue)) { - errorMessages.push(...errorValue.map((error: any) => formatError(errorKey, error))); + errorMessages.push(...errorValue.map((error: any) => formatError(error))); } else { - errorMessages.push(formatError(errorKey, errorValue)); + errorMessages.push(formatError(errorValue)); } } return errorMessages.join(' '); } -function formatError(errorKey: string, error: any): string { +function formatError(error: any): string { if (typeof error === 'object') { - return `${errorKey}: ${Object.values(error).join(' ')}`; + return Object.values(error).join(' '); } - return `${errorKey}: ${error}`; + return error; }