refactor getAppSettings endpoint to user settingsService as source of truth
This commit is contained in:
1 parent
114f4ffb05
commit
b6a7cfa7cc
1 file changed
+2
-2
@@ -4,7 +4,7 @@ const { updateAppSettingsBodyValidation } = require("../validation/joi");
|
|||||||
|
|
||||||
const getAppSettings = async (req, res, next) => {
|
const getAppSettings = async (req, res, next) => {
|
||||||
try {
|
try {
|
||||||
const settings = await req.db.getAppSettings();
|
const settings = await req.settingsService.getSettings();
|
||||||
return res.status(200).json({
|
return res.status(200).json({
|
||||||
success: true,
|
success: true,
|
||||||
msg: successMessages.GET_APP_SETTINGS,
|
msg: successMessages.GET_APP_SETTINGS,
|
||||||
@@ -30,7 +30,7 @@ const updateAppSettings = async (req, res, next) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const settings = await req.db.updateAppSettings(req.body);
|
await req.db.updateAppSettings(req.body);
|
||||||
const updatedSettings = await req.settingsService.reloadSettings();
|
const updatedSettings = await req.settingsService.reloadSettings();
|
||||||
return res.status(200).json({
|
return res.status(200).json({
|
||||||
success: true,
|
success: true,
|
||||||
|
|||||||
Reference in new issue
Block a user