From 3525fb12e65a7e32227c2fc43a04ded5cafc9eab Mon Sep 17 00:00:00 2001 From: Mathis Date: Fri, 3 May 2024 11:23:13 +0200 Subject: [PATCH] feat(routes): add create vehicle function to route This commit hooks up the `VehicleController.create` function to the route handling post requests at `/veh/new`. With this change, admin users can add new vehicles via this endpoint. Signed-off-by: Mathis --- src/routes/rent/rentRouter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/rent/rentRouter.ts b/src/routes/rent/rentRouter.ts index 3cad5bb..c8da831 100644 --- a/src/routes/rent/rentRouter.ts +++ b/src/routes/rent/rentRouter.ts @@ -12,7 +12,7 @@ RentRouter.route("/affected").get(UserGuard); RentRouter.route("/affected/all").get(AdminGuard); // Add a new vehicle (admin only) -RentRouter.route("/veh/new").post(AdminGuard); +RentRouter.route("/veh/new").post(AdminGuard, VehicleController.create); // Get all vehicles RentRouter.route("/veh/all").get(VehicleController.getAll);