From e70c3e0331216d948c70fde62c0b2d540f97dcec Mon Sep 17 00:00:00 2001
From: razzanYoni <13521087@mahasiswa.itb.ac.id>
Date: Wed, 15 Nov 2023 16:27:56 +0700
Subject: [PATCH] fix : application/json data request

---
 src/cores/app.ts           |  2 ++
 src/routers/auth-router.ts | 11 +++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/cores/app.ts b/src/cores/app.ts
index b3c0c34..bd4a5d6 100644
--- a/src/cores/app.ts
+++ b/src/cores/app.ts
@@ -29,6 +29,8 @@ app.use(cors({
   credentials: true
 }));
 
+app.use(express.json());
+
 app.use(cookieParser());
 app.use(apiRouter);
 
diff --git a/src/routers/auth-router.ts b/src/routers/auth-router.ts
index baef16a..9cfd8f0 100644
--- a/src/routers/auth-router.ts
+++ b/src/routers/auth-router.ts
@@ -1,11 +1,18 @@
 import express, { Router } from "express";
 import * as AuthController from "../controllers/auth-controller";
 import { handleStandardError } from "../middlewares/handle-standard-error";
+import multer from "multer";
 
 const authRouter: Router = express.Router();
 
-authRouter.post("/api/signup", AuthController.signup, handleStandardError);
+authRouter.post(
+  "/api/signup",
+  AuthController.signup,
+  handleStandardError);
 
-authRouter.post("/api/login", AuthController.login, handleStandardError);
+authRouter.post(
+  "/api/login",
+  AuthController.login,
+  handleStandardError);
 
 export { authRouter };
-- 
GitLab