Skip to content

Commit e92c9f6

Browse files
authored
Merge pull request #1589 from contentstack/fix/duplicate-project-issue
fix: duplicate project error issue
2 parents bfbc0aa + 8a76cbe commit e92c9f6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/contentstack-variants/src/utils/error-helper.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ export function formatErrors(errors: any): string {
99
for (const errorKey in errors) {
1010
const errorValue = errors[errorKey];
1111
if (Array.isArray(errorValue)) {
12-
errorMessages.push(...errorValue.map((error: any) => formatError(errorKey, error)));
12+
errorMessages.push(...errorValue.map((error: any) => formatError(error)));
1313
} else {
14-
errorMessages.push(formatError(errorKey, errorValue));
14+
errorMessages.push(formatError(errorValue));
1515
}
1616
}
1717

1818
return errorMessages.join(' ');
1919
}
2020

21-
function formatError(errorKey: string, error: any): string {
21+
function formatError(error: any): string {
2222
if (typeof error === 'object') {
23-
return `${errorKey}: ${Object.values(error).join(' ')}`;
23+
return Object.values(error).join(' ');
2424
}
25-
return `${errorKey}: ${error}`;
25+
return error;
2626
}

0 commit comments

Comments
 (0)