-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(core): update submit create account errors message
- Loading branch information
1 parent
1971781
commit 5748c49
Showing
3 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
core/app/[locale]/(default)/account/(tabs)/_components/utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |