Skip to content

Commit

Permalink
added auth
Browse files Browse the repository at this point in the history
  • Loading branch information
DerickPascual committed Nov 9, 2024
1 parent 05e16bf commit ce7ea7f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions server/routes/student.router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ const router = express.Router();
const {wrapMiddleware, wrapController} = require("../helper");
const {studentController} = require("../controllers");
const studentValidation = require("../validations/student.validation");
const jwtAuthen = require("../validations/jwtAuthen");

router.post("/create", wrapMiddleware(studentValidation.create), wrapController(studentController.create));
router.put("/:id", wrapMiddleware(studentValidation.update), wrapController(studentController.update));
router.delete("/:id", wrapMiddleware(studentValidation.delete), wrapController(studentController.delete))
router.get("/:id", wrapMiddleware(studentValidation.findById), wrapController(studentController.findById));
router.post("/create", jwtAuthen, wrapMiddleware(studentValidation.create), wrapController(studentController.create));
router.put("/:id", jwtAuthen, wrapMiddleware(studentValidation.update), wrapController(studentController.update));
router.delete("/:id", jwtAuthen, wrapMiddleware(studentValidation.delete), wrapController(studentController.delete))
router.get("/:id", jwtAuthen, wrapMiddleware(studentValidation.findById), wrapController(studentController.findById));



Expand Down

0 comments on commit ce7ea7f

Please sign in to comment.