Skip to content

Commit 38068f0

Browse files
committed
feat(global): new codes
1 parent 3a22246 commit 38068f0

File tree

8 files changed

+42
-16
lines changed

8 files changed

+42
-16
lines changed

src/codes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import { IErrors } from './types';
44
import authentication from './resources/authentication';
55
import signIn from './resources/signIn';
66
import signUp from './resources/signUp';
7+
import passwordForgotten from './resources/passwordForgotten';
78
import general from './resources/general';
89

910
const codes: IErrors = {
1011
authentication,
1112
signIn,
1213
signUp,
14+
passwordForgotten,
1315
general,
1416
};
1517

src/resources/authentication/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { II18n, IErrorRes, EHttpCode } from '../../types';
1+
import { II18n, EHttpCode } from '../../types';
22

33
// Locales
44
import * as fr from './locales/fr.json';
55
import * as en from './locales/en.json';
66

77
const i18n: II18n = { fr, en };
88

9-
const authentication: IErrorRes = {
9+
export default {
1010
client: {
1111
loginFailed: {
1212
status: EHttpCode.UNAUTHORIZED,
@@ -28,5 +28,3 @@ const authentication: IErrorRes = {
2828
external: {},
2929
i18n,
3030
};
31-
32-
export default authentication;

src/resources/general/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { II18n, IErrorRes, EHttpCode } from '../../types';
1+
import { II18n, EHttpCode } from '../../types';
22

33
// Locales
44
import * as fr from './locales/fr.json';
55
import * as en from './locales/en.json';
66

77
const i18n: II18n = { fr, en };
88

9-
const general: IErrorRes = {
9+
export default {
1010
client: {},
1111
internal: {
1212
unexpected: {
@@ -16,5 +16,3 @@ const general: IErrorRes = {
1616
external: {},
1717
i18n,
1818
};
19-
20-
export default general;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { II18n, EHttpCode } from '../../types';
2+
3+
// Locales
4+
import * as fr from './locales/fr.json';
5+
import * as en from './locales/en.json';
6+
7+
const i18n: II18n = { fr, en };
8+
9+
export default {
10+
client: {
11+
accountNotFound: {
12+
status: EHttpCode.BAD_REQUEST,
13+
},
14+
},
15+
internal: {},
16+
external: {},
17+
i18n,
18+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"client": {
3+
"accountNotFound": "Account not found"
4+
},
5+
"internal": {},
6+
"external": {}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"client": {
3+
"accountNotFound": "Aucun compte trouvé"
4+
},
5+
"internal": {},
6+
"external": {}
7+
}

src/resources/signIn/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { II18n, IErrorRes, EHttpCode } from '../../types';
1+
import { II18n, EHttpCode } from '../../types';
22

33
// Locales
44
import * as fr from './locales/fr.json';
55
import * as en from './locales/en.json';
66

77
const i18n: II18n = { fr, en };
88

9-
const signIn: IErrorRes = {
9+
export default {
1010
client: {
1111
formInvalidEmail: {
1212
status: EHttpCode.BAD_REQUEST,
@@ -25,5 +25,3 @@ const signIn: IErrorRes = {
2525
external: {},
2626
i18n,
2727
};
28-
29-
export default signIn;

src/resources/signUp/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { II18n, IErrorRes, EHttpCode } from '../../types';
1+
import { II18n, EHttpCode } from '../../types';
22

33
// Locales
44
import * as fr from './locales/fr.json';
55
import * as en from './locales/en.json';
66

77
const i18n: II18n = { fr, en };
88

9-
const signUp: IErrorRes = {
9+
export default {
1010
client: {
1111
formInvalidEmail: {
1212
status: EHttpCode.BAD_REQUEST,
@@ -25,5 +25,3 @@ const signUp: IErrorRes = {
2525
external: {},
2626
i18n,
2727
};
28-
29-
export default signUp;

0 commit comments

Comments
 (0)