const {authJwt} = require("../middlewares");
module.exports = app => {
	const seating = require("../controllers/seating.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();
	// Retrieve all seatings
	router.get("/", [authJwt.verifyToken],seating.getAllSeatings);
	// Create a new seating
	router.post("/", [authJwt.verifyToken], seating.createNewSeating);
	router.put('/:id', [authJwt.verifyToken], seating.updateSeating);
	router.delete('/:id', [authJwt.verifyToken], seating.deleteSeating)
	app.use('/api/seatings', router);
};