Skip to content

Commit e100265

Browse files
committed
feat(global): new errors
1 parent 4f773ca commit e100265

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

src/codes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { IErrors } from './types';
22

33
// Resources
44
import authentication from './resources/authentication';
5+
import signIn from './resources/signIn';
56
import general from './resources/general';
67

78
const codes: IErrors = {
89
authentication,
10+
signIn,
911
general,
1012
};
1113

src/resources/signIn/index.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { II18n, IErrorRes, EHttpCode } from '../../types';
2+
import * as fr_FR from './locales/fr_FR.json';
3+
import * as en_US from './locales/en_US.json';
4+
5+
const i18n: II18n = { fr_FR, en_US };
6+
7+
const authentication: IErrorRes = {
8+
client: {
9+
formInvalidEmail: {
10+
status: EHttpCode.BAD_REQUEST,
11+
},
12+
formInvalidPassword: {
13+
status: EHttpCode.BAD_REQUEST,
14+
},
15+
},
16+
internal: {},
17+
external: {},
18+
i18n,
19+
};
20+
21+
export default authentication;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"client": {
3+
"formInvalidEmail": "Invalid email",
4+
"formInvalidPassword": "Invalid password"
5+
},
6+
"internal": {},
7+
"external": {}
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"client": {
3+
"formInvalidEmail": "Email invalide",
4+
"formInvalidPassword": "Mot de passe invalide"
5+
},
6+
"internal": {},
7+
"external": {}
8+
}

0 commit comments

Comments
 (0)