const express = require("express");
const router = express.Router();

const { cmsController } = require("../../controllers/admin/cmsController");
const { adminAuth } = require("../../middlewares/adminAuth");
const { uploadSingleImg } = require("../../utils/uploadSingleImg");
const { uploadMultipleImgs } = require("../../utils/uploadMultipleImgs");

router.post(
  "/update-contact-details",
  adminAuth,
  cmsController.updateContactDetails
);
router.get("/get-contact-details", adminAuth, cmsController.getContactDetails);
router.post(
  "/update-privacy-policy",
  adminAuth,
  cmsController.updatePrivacyPolicy
);
router.get("/get-privacy-policy", adminAuth, cmsController.getPrivacyPolicy);
router.post("/update-terms", adminAuth, cmsController.updateTermsNConditions);
router.get("/get-terms", adminAuth, cmsController.getTermsNConditions);
router.post("/add-faq", adminAuth, cmsController.addFaq);
router.post("/update-faq", adminAuth, cmsController.updateFaq);
router.delete("/delete-faq", adminAuth, cmsController.deleteFaq);
router.get("/get-faq-details", adminAuth, cmsController.getFaqDetails);
router.get("/get-all-faqs", adminAuth, cmsController.getAllFaqs);
router.post(
  "/add-section",
  adminAuth,
  uploadSingleImg,
  cmsController.addSection
);
router.post(
  "/update-section",
  adminAuth,
  uploadSingleImg,
  cmsController.updateSection
);
router.delete("/delete-section", adminAuth, cmsController.deleteSection);
router.get("/get-sections", adminAuth, cmsController.getSections);
router.get("/get-section-detail", adminAuth, cmsController.getSectionDetails);
router.post("/add-location", adminAuth, cmsController.addLocation);
router.post(
  "/add-location-images",
  adminAuth,
  uploadMultipleImgs,
  cmsController.addLocationImages
);

module.exports = router;
