Merge branch 'main' of https://gits.techvanguard.vn/UKSOURCE/cms.hailearning.edu.vn into fea/bao-03022026-Admin-Management-Service

This commit is contained in:
nguyenvanbao
2026-02-04 09:18:42 +07:00
25 changed files with 4638 additions and 925 deletions

View File

@@ -157,6 +157,52 @@ router.get(
contactController.getContactData,
);
// Contact submissions management
router.get(
"/contact/submissions",
ensureAuthenticated,
contactController.getSubmissions
);
router.put(
"/contact/submissions/:id",
ensureAuthenticated,
contactController.updateSubmissionStatus
);
// Appointment management
const appointmentController = require("../controllers/appointmentController");
router.get(
"/appointments",
ensureAuthenticated,
appointmentController.getAppointments
);
router.get(
"/appointments/:id",
ensureAuthenticated,
appointmentController.getAppointmentById
);
router.put(
"/appointments/:id",
ensureAuthenticated,
appointmentController.updateAppointmentStatus
);
router.delete(
"/appointments/:id",
ensureAuthenticated,
appointmentController.deleteAppointment
);
// Appointment CMS page management
router.get("/appointment", ensureAuthenticated, appointmentController.index);
router.post("/appointment/update", ensureAuthenticated, appointmentController.update);
router.get("/appointment/data", ensureAuthenticated, appointmentController.getAppointmentData);
// Pricing CMS page management
const pricingController = require("../controllers/pricingController");
router.get("/pricing", ensureAuthenticated, pricingController.index);
router.post("/pricing/update", ensureAuthenticated, pricingController.update);
router.get("/pricing/data", ensureAuthenticated, pricingController.getPricingData);
// Activity CRUD routes
router.get("/activity", ensureAuthenticated, activityController.index);
router.get(
@@ -355,9 +401,9 @@ router.post(
// Test Image Paths route
router.get("/test-images", ensureAuthenticated, (req, res) => {
const fs = require("fs");
const path = require("path");
const campLocationData = require("../data/camp-location.json");
const fs = require('fs');
const path = require('path');
const campLocationData = require('../data/camp-location.json');
// Collect all image paths
const imagePaths = [];
@@ -408,9 +454,9 @@ router.get("/test-images", ensureAuthenticated, (req, res) => {
});
}
res.render("admin/test-images", {
layout: "layouts/admin",
title: "Test Image Paths",
res.render('admin/test-images', {
layout: 'layouts/admin',
title: 'Test Image Paths',
images: imagePaths,
user: req.session.user,
});

View File

@@ -56,6 +56,18 @@ router.get("/api/footer", footerController.api);
// Contact API route
router.get("/api/contact", contactController.api);
// Contact form submission (public)
router.post("/api/contact/submit", contactController.submitForm);
// Appointment API
const appointmentController = require("../controllers/appointmentController");
router.get("/api/appointment", appointmentController.api);
router.post("/api/appointment/submit", appointmentController.submitAppointment);
// Pricing API
const pricingController = require("../controllers/pricingController");
router.get("/api/pricing", pricingController.api);
router.get("/api/faq", faqController.api);
// Safety API route
router.get("/api/safety", safetyController.api);