brief-05-back/src/routes/rent/rentRouter.ts
Mathis 56bfd8cd0d
type: style
scope: services, interfaces

subject: Apply code formatting

- Correct indentation and formatting to match code style standards in multiple 'interfaces' and 'services' files.
- Also ensure lines at the end of the files.

Signed-off-by: Mathis <yidhra@tuta.io>
2024-04-30 10:55:37 +02:00

28 lines
711 B
TypeScript

import AdminGuard from "@validators/AdminGuard";
import UserGuard from "@validators/UserGuard";
import express, { type Router } from "express";
const RentRouter: Router = express.Router();
// Get rent affected to the user
RentRouter.route("/affected").get(UserGuard);
// Get all vehicle in rent (admin only)
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();
// Rent a specific vehicle
RentRouter.route("/veh/rent/:vehicleId").post(UserGuard);
RentRouter.route("/veh/:vehicleId")
.get(UserGuard)
.patch(AdminGuard)
.delete(AdminGuard);
export default RentRouter;