Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sevelinCa committed Jul 21, 2024
1 parent 6d90e72 commit d57182c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 46 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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);
Expand Down
85 changes: 41 additions & 44 deletions src/routes/user.route.ts
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit d57182c

Please sign in to comment.