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:
parent
82afff9878
commit
3525fb12e6
@ -12,7 +12,7 @@ RentRouter.route("/affected").get(UserGuard);
|
|||||||
RentRouter.route("/affected/all").get(AdminGuard);
|
RentRouter.route("/affected/all").get(AdminGuard);
|
||||||
|
|
||||||
// Add a new vehicle (admin only)
|
// Add a new vehicle (admin only)
|
||||||
RentRouter.route("/veh/new").post(AdminGuard);
|
RentRouter.route("/veh/new").post(AdminGuard, VehicleController.create);
|
||||||
|
|
||||||
// Get all vehicles
|
// Get all vehicles
|
||||||
RentRouter.route("/veh/all").get(VehicleController.getAll);
|
RentRouter.route("/veh/all").get(VehicleController.getAll);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user