forked from UKSOURCE/cms.lams
feat(admin): implement unified submission and newsletter management
Introduce a centralized system to manage all website form submissions and newsletter subscriptions. - Add `Submission` and `NewsletterSubscription` models with MongoDB schema validation - Implement `submissionController` and `newsletterSubscriptionController` for CRUD operations and filtering - Create a unified admin UI for reviewing submissions across different sources (home, request, contact, partnership, newsletter) - Add database migration scripts for creating collections and indexes - Refactor partnership inquiry forms to use a fixed field structure - Update admin navigation and server CORS settings to support PATCH requests
This commit is contained in:
@@ -19,6 +19,8 @@ const formController = require("../controllers/formController");
|
||||
const contactController = require("../controllers/contactController");
|
||||
const studentSupportController = require("../controllers/studentSupportController");
|
||||
const requestInfoController = require("../controllers/requestInfoController");
|
||||
const submissionController = require("../controllers/submissionController");
|
||||
const newsletterSubscriptionController = require("../controllers/newsletterSubscriptionController");
|
||||
|
||||
const pageController = require("../controllers/pageController");
|
||||
const settingController = require("../controllers/settingController");
|
||||
@@ -199,6 +201,27 @@ router.put(
|
||||
contactController.updateSubmissionStatus,
|
||||
);
|
||||
|
||||
// Unified submission management
|
||||
router.get("/submissions", ensureAuthenticated, submissionController.index);
|
||||
router.get("/submissions/data", ensureAuthenticated, submissionController.list);
|
||||
router.get("/submissions/:id", ensureAuthenticated, submissionController.detail);
|
||||
router.patch("/submissions/:id", ensureAuthenticated, submissionController.update);
|
||||
router.get(
|
||||
"/newsletter-subscriptions/data",
|
||||
ensureAuthenticated,
|
||||
newsletterSubscriptionController.list,
|
||||
);
|
||||
router.get(
|
||||
"/newsletter-subscriptions/:id",
|
||||
ensureAuthenticated,
|
||||
newsletterSubscriptionController.detail,
|
||||
);
|
||||
router.patch(
|
||||
"/newsletter-subscriptions/:id",
|
||||
ensureAuthenticated,
|
||||
newsletterSubscriptionController.update,
|
||||
);
|
||||
|
||||
// Student Support (LAMS static page)
|
||||
router.get(
|
||||
"/student-support",
|
||||
|
||||
Reference in New Issue
Block a user