import express from 'express';

const router = express.Router();
import {indexController} from '../controller/index-controller';

router.get("/", indexController.showAllRoutes);

router.post("/toggleStyle", indexController.toggleStyle.bind(indexController));
router.post("/toggleCompleted", indexController.toggleCompleted.bind(indexController));

router.get("/sortByDifficulty", indexController.sortByDifficulty.bind(indexController));
router.get("/sortByTitle", indexController.sortByTitle.bind(indexController));
router.get("/sortByCreationDate", indexController.sortByCreationDate.bind(indexController));

router.get("/add", indexController.addBoulderRoute.bind(indexController));
router.post("/add", indexController.saveBoulderRoute.bind(indexController));
router.post("/add/:id", indexController.updateBoulderRoute.bind(indexController));
router.get("/:id", indexController.detailView.bind(indexController));
export const indexRoutes = router;

