From 75d436fffdda4a24e42addd311521c79ad7fe390 Mon Sep 17 00:00:00 2001 From: Abdul Rahman Reza Date: Sun, 1 Dec 2024 10:50:42 +0700 Subject: [PATCH] update language --- src/helpers/express/return.ts | 2 +- src/routes/public.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/helpers/express/return.ts b/src/helpers/express/return.ts index a0fde5c..2132b3f 100644 --- a/src/helpers/express/return.ts +++ b/src/helpers/express/return.ts @@ -51,7 +51,7 @@ export class ReturnHelper { return res.status(status_code || 200).json({ status: false, error_code: error_code || 400, - message: message || "success", + message: message || "failed", error: error, }); }; diff --git a/src/routes/public.ts b/src/routes/public.ts index 29f7dd1..1182e34 100644 --- a/src/routes/public.ts +++ b/src/routes/public.ts @@ -2,10 +2,13 @@ import express from 'express'; import { AuthController } from '../controllers/auth'; import { UserController } from '../controllers/user'; +import { Language } from '../langs/lang'; export class RoutePublic { static setup(app: express.Application) { + app.use(Language.apply); + app.post('/api/login', AuthController.login) app.put('/api/reset_password/:email', AuthController.resetPassword) app.put('/api/update_password/:token', AuthController.updatePassword)