Skip to content

Commit

Permalink
refactor(core): update submit create account errors message
Browse files Browse the repository at this point in the history
  • Loading branch information
bc-alexsaiannyi committed Dec 6, 2024
1 parent 5a83f6d commit d992865
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions core/app/[locale]/(default)/account/(tabs)/_components/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
interface GenericError {
[p: string]: string | string[];
message: string;
}

export const createErrorsList = (submitErrors: GenericError[]) =>
submitErrors
.map((error) => {
if (submitErrors.length > 1) {
return `\u2022 ${error.message}`;
}

return error.message;
})
.join('\n');

0 comments on commit d992865

Please sign in to comment.