From 65a6ae2e3c48f1bfb70a654efc976328bdd4c1a4 Mon Sep 17 00:00:00 2001 From: Mathis Date: Fri, 3 May 2024 13:18:46 +0200 Subject: [PATCH] feat(routes): update rent related routes - The "/affected" route has been updated to now use the `RentController.getAssignedToUser` method. - The "/affected/all" route, which was previously not implemented, now utilizes the `RentController.getAll` function. - These changes will help facilitate the retrieval of individual and all rented vehicles. Signed-off-by: Mathis --- src/routes/rent/rentRouter.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/routes/rent/rentRouter.ts b/src/routes/rent/rentRouter.ts index c8da831..405f841 100644 --- a/src/routes/rent/rentRouter.ts +++ b/src/routes/rent/rentRouter.ts @@ -2,14 +2,15 @@ import AdminGuard from "@validators/AdminGuard"; import UserGuard from "@validators/UserGuard"; import express, { type Router } from "express"; import VehicleController from "@controllers/vehicle.controller"; +import RentController from "@controllers/rent.controller"; const RentRouter: Router = express.Router(); // Get rent affected to the user -RentRouter.route("/affected").get(UserGuard); +RentRouter.route("/affected").get(UserGuard, RentController.getAssignedToUser); -// Get all vehicle in rent (admin only) //TODO Non implemented yet -RentRouter.route("/affected/all").get(AdminGuard); +// Get all vehicle in rent (admin only) +RentRouter.route("/affected/all").get(AdminGuard, RentController.getAll); // Add a new vehicle (admin only) RentRouter.route("/veh/new").post(AdminGuard, VehicleController.create);