diff --git a/src/routes/rent/rentRouter.ts b/src/routes/rent/rentRouter.ts index f3bd302..3cad5bb 100644 --- a/src/routes/rent/rentRouter.ts +++ b/src/routes/rent/rentRouter.ts @@ -1,27 +1,28 @@ import AdminGuard from "@validators/AdminGuard"; import UserGuard from "@validators/UserGuard"; import express, { type Router } from "express"; +import VehicleController from "@controllers/vehicle.controller"; const RentRouter: Router = express.Router(); // Get rent affected to the user RentRouter.route("/affected").get(UserGuard); -// Get all vehicle in rent (admin only) +// Get all vehicle in rent (admin only) //TODO Non implemented yet RentRouter.route("/affected/all").get(AdminGuard); // Add a new vehicle (admin only) RentRouter.route("/veh/new").post(AdminGuard); // Get all vehicles -RentRouter.route("/veh/all").get(); +RentRouter.route("/veh/all").get(VehicleController.getAll); // Rent a specific vehicle RentRouter.route("/veh/rent/:vehicleId").post(UserGuard); RentRouter.route("/veh/:vehicleId") - .get(UserGuard) - .patch(AdminGuard) - .delete(AdminGuard); + .get(UserGuard, VehicleController.getById) + .patch(AdminGuard, VehicleController.update) + .delete(AdminGuard, VehicleController.delete); export default RentRouter;