2024-10-15 11:57:37 +08:00
|
|
|
import { Router } from "express";
|
|
|
|
|
import { isAllowed } from "../middleware/isAllowed.js";
|
|
|
|
|
|
2024-12-24 11:58:56 -08:00
|
|
|
class SettingsRoutes {
|
|
|
|
|
constructor(settingsController) {
|
|
|
|
|
this.router = Router();
|
|
|
|
|
this.settingsController = settingsController;
|
|
|
|
|
this.initRoutes();
|
|
|
|
|
}
|
2024-09-26 13:41:50 +08:00
|
|
|
|
2024-12-24 11:58:56 -08:00
|
|
|
initRoutes() {
|
|
|
|
|
this.router.get("/", this.settingsController.getAppSettings);
|
|
|
|
|
this.router.put(
|
|
|
|
|
"/",
|
|
|
|
|
isAllowed(["superadmin"]),
|
|
|
|
|
this.settingsController.updateAppSettings
|
|
|
|
|
);
|
|
|
|
|
}
|
2024-09-26 13:41:50 +08:00
|
|
|
|
2024-12-24 11:58:56 -08:00
|
|
|
getRouter() {
|
|
|
|
|
return this.router;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default SettingsRoutes;
|