Add app settings model, routes, db ops, service, use settings for issueToken

This commit is contained in:
Alex Holliday committed 2024-09-26 13:41:50 +08:00
1 parent b2bc441c7f
commit 992bf099fa
12 files changed
+210 -19

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
const { successMessages } = require("../utils/messages");
const SERVICE_NAME = "SettingsController";
const getAppSettings = async (req, res, next) => {
try {
const settings = await req.db.getAppSettings();
return res.status(200).json({
success: true,
msg: successMessages.GET_APP_SETTINGS,
data: settings,
});
} catch (error) {
error.service === undefined ? (error.service = SERVICE_NAME) : null;
error.method === undefined ? (error.method = "getAppSettings") : null;
}
};
module.exports = {
getAppSettings,
};