const {authJwt} = require("../middlewares");
module.exports = app => {
	const vehicleRepairs = require("../controllers/vehicle-repair.controller.js");
	app.use((req, res, next) => {
		res.header(
			"Access-Control-Allow-Headers",
			"x-access-token, Origin, Content-Type, Accept"
		);
		next();
	});
	var router = require("express").Router();
	router.get("/", [authJwt.verifyToken], vehicleRepairs.getAllVehicleRepairs);
	router.post("/", [authJwt.verifyToken], vehicleRepairs.createVehicleRepair);
	router.put("/:id", [authJwt.verifyToken], vehicleRepairs.updateVehicleRepair);
	router.delete("/:id", [authJwt.verifyToken], vehicleRepairs.deleteVehicleRepair);
	app.use('/api/vehicle-repairs', router);
};