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 <yidhra@tuta.io>
This commit is contained in:
Mathis H (Avnyr) 2024-05-03 11:23:13 +02:00
parent 82afff9878
commit 3525fb12e6
Signed by: Mathis
GPG Key ID: DD9E0666A747D126

View File

@ -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);