From d57182c6296fb6c72d6946f735404d4a29b342d3 Mon Sep 17 00:00:00 2001 From: sevelinCA Date: Sun, 21 Jul 2024 22:48:18 +0200 Subject: [PATCH] updates --- src/index.ts | 4 +- src/routes/user.route.ts | 85 +++++++++++++++++++--------------------- 2 files changed, 43 insertions(+), 46 deletions(-) diff --git a/src/index.ts b/src/index.ts index f75ebf2..9cf93dd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,7 +23,7 @@ import roleRoute from "./routes/roles.route"; import checkoutRoute from "./routes/checkout.router"; import googleAuthRoute from "./routes/googleAuth.route"; import cartroute from "./routes/cart.route"; -import TwoFaRoute from "./routes/2fa.route"; +// import TwoFaRoute from "./routes/2fa.route"; import orderRoute from "./routes/order.route"; import messageRoutes from "./routes/messages.route"; @@ -103,7 +103,7 @@ app.use("/api-docs", swaggerRoute); app.use("/admin", adminRoute); app.use("/", cartroute); app.use("/", wishlistroute); -app.use("/", TwoFaRoute); +// app.use("/", TwoFaRoute); app.use("/", messageRoutes); diff --git a/src/routes/user.route.ts b/src/routes/user.route.ts index f96ce8a..04ee836 100644 --- a/src/routes/user.route.ts +++ b/src/routes/user.route.ts @@ -1,46 +1,43 @@ +import express from 'express'; +import { + Welcome, + allUsers, + allVendors, + deleteUser, + editUser, + findUser, + login, + register, + updatePassword, + verifyEmail, + getUserInfo +} from '../controllers/user.controller'; +import { VerifyAccessToken } from '../middleware/verfiyToken'; +import { addFeedback, addReview, selectFeedback } from '../controllers/review.controller'; -import express,{Request,Response} from "express"; -import { - Welcome, - allUsers, - allVendors, - deleteUser, - editUser, - findUser, - login, - register, - updatePassword, - verifyEmail, - getUserInfo -} from "../controllers/user.controller"; - -import { VerifyAccessToken } from "../middleware/verfiyToken"; - -import { addFeedback, addReview, selectFeedback } from "../controllers/review.controller"; - -const route = express.Router(); - -route.get("/", Welcome); - -route.get("/finduser/:id", findUser) -route.get("/allusers", allUsers) -route.get("/allvendors", allVendors) -route.post("/register", register); -route.patch("/updateuser/:id", editUser); -route.patch("/updatepassword/:id", updatePassword); -route.delete("/deleteuser/:id", VerifyAccessToken, deleteUser); -route.post("/login", login); -route.post("/addreview/:id", addReview); -route.post("/addfeedback/:id", addFeedback); - -route.get("/getfeedback/:id", selectFeedback); - -route.get("/verfiy-email", verifyEmail); -route.get("/user-info/:id", getUserInfo); - -route.get("/finduser/:id", findUser); -route.get("/allusers", allUsers); -route.get("/allvendors", allVendors); - -export default route; +const router = express.Router(); + +// Route definitions +router.get('/', Welcome); + +router.get('/finduser/:id', findUser); +router.get('/allusers', allUsers); +router.get('/allvendors', allVendors); + +router.post('/register', register); +router.patch('/updateuser/:id', editUser); +router.patch('/updatepassword/:id', updatePassword); + +router.delete('/deleteuser/:id', VerifyAccessToken, deleteUser); + +router.post('/login', login); +router.post('/addreview/:id', addReview); +router.post('/addfeedback/:id', addFeedback); + +router.get('/getfeedback/:id', selectFeedback); + +router.get('/verfiy-email', verifyEmail); +router.get('/user-info/:id', getUserInfo); + +export default router;