forked from UKSOURCE/cms.hailearning.edu.vn
feat: Implement admin management for FAQ, Testimonial, and Video Gallery sections with new controllers, views, and routing.
This commit is contained in:
@@ -30,6 +30,9 @@ const blogController = require("../controllers/blogController");
|
||||
const blogCategoryController = require("../controllers/blogCategoryController");
|
||||
const blogTagController = require("../controllers/blogTagController");
|
||||
const socialLinkController = require("../controllers/socialLinkController");
|
||||
const testimonialController = require("../controllers/testimonialController");
|
||||
const videoGalleryController = require("../controllers/videoGalleryController");
|
||||
|
||||
|
||||
// Dashboard
|
||||
router.get("/dashboard", ensureAuthenticated, dashboardController.getDashboard);
|
||||
@@ -333,24 +336,14 @@ router.get(
|
||||
activityController.preview,
|
||||
);
|
||||
|
||||
// FAQ routes - Thêm vào đây
|
||||
router.get("/faq", ensureAuthenticated, faqController.index);
|
||||
router.post("/faq/update", ensureAuthenticated, faqController.update);
|
||||
router.get("/faq/data", ensureAuthenticated, faqController.getFAQData);
|
||||
router.get("/faq/api", faqController.api);
|
||||
// FAQ routes
|
||||
router.get("/home/faq", ensureAuthenticated, faqController.index);
|
||||
router.post("/home/faq/update", ensureAuthenticated, faqController.update);
|
||||
router.get("/home/faq/data", ensureAuthenticated, faqController.getFAQData);
|
||||
router.get("/home/faq/api", faqController.api);
|
||||
|
||||
// Deprecated FAQ API routes removed
|
||||
|
||||
// API routes cho quản lý FAQ items (AJAX calls)
|
||||
router.post("/faq/api/add-faq", ensureAuthenticated, faqController.addFAQ);
|
||||
router.put(
|
||||
"/faq/api/update-faq-item/:sectionId/:faqId",
|
||||
ensureAuthenticated,
|
||||
faqController.updateFAQItem,
|
||||
);
|
||||
router.delete(
|
||||
"/faq/api/delete-faq-item/:sectionId/:faqId",
|
||||
ensureAuthenticated,
|
||||
faqController.deleteFAQItem,
|
||||
);
|
||||
router.get("/terms-conditions", ensureAuthenticated, termsController.index);
|
||||
router.post("/terms/update", ensureAuthenticated, termsController.update);
|
||||
router.get("/terms/data", ensureAuthenticated, termsController.getTermsData);
|
||||
@@ -365,34 +358,8 @@ router.get("/travel/data", ensureAuthenticated, travelController.getTravelData);
|
||||
router.get("/travel/api", travelController.api);
|
||||
router.get("/travel/seed", ensureAuthenticated, travelController.seed);
|
||||
|
||||
// API routes cho quản lý FAQ sections (AJAX calls)
|
||||
router.post(
|
||||
"/faq/api/add-section",
|
||||
ensureAuthenticated,
|
||||
faqController.addFAQSection,
|
||||
);
|
||||
router.put(
|
||||
"/faq/api/update-section/:sectionId",
|
||||
ensureAuthenticated,
|
||||
faqController.updateFAQSection,
|
||||
);
|
||||
router.delete(
|
||||
"/faq/api/delete-section/:sectionId",
|
||||
ensureAuthenticated,
|
||||
faqController.deleteFAQSection,
|
||||
);
|
||||
router.post(
|
||||
"/faq/api/reorder-sections",
|
||||
ensureAuthenticated,
|
||||
faqController.reorderFAQSection,
|
||||
);
|
||||
// Deprecated FAQ API routes removed
|
||||
|
||||
// API routes cho sidebar navigation (AJAX calls)
|
||||
router.put(
|
||||
"/faq/api/update-sidebar",
|
||||
ensureAuthenticated,
|
||||
faqController.updateSidebarNav,
|
||||
);
|
||||
|
||||
// Safety routes
|
||||
router.get("/safety", ensureAuthenticated, safetyController.index);
|
||||
@@ -603,4 +570,14 @@ router.post(
|
||||
blogTagController.quickCreate,
|
||||
);
|
||||
|
||||
// Testimonials management
|
||||
router.get("/home/testimonials", ensureAuthenticated, testimonialController.index);
|
||||
router.post("/home/testimonials/update", ensureAuthenticated, testimonialController.update);
|
||||
|
||||
// Video Gallery management
|
||||
router.get("/home/video-gallery", ensureAuthenticated, videoGalleryController.index);
|
||||
router.post("/home/video-gallery/update", ensureAuthenticated, videoGalleryController.update);
|
||||
|
||||
module.exports = router;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user