use response middleware in SettingsController

This commit is contained in:
Alex Holliday committed 2025-01-19 12:05:15 -08:00
1 parent 3608eadb8c
commit 627c80581d
1 file changed
+2 -4
+2 -4
View File
@@ -13,8 +13,7 @@ class SettingsController {
try { try {
const settings = { ...(await this.settingsService.getSettings()) }; const settings = { ...(await this.settingsService.getSettings()) };
delete settings.jwtSecret; delete settings.jwtSecret;
return res.status(200).json({ return res.successs({
success: true,
msg: successMessages.GET_APP_SETTINGS, msg: successMessages.GET_APP_SETTINGS,
data: settings, data: settings,
}); });
@@ -35,8 +34,7 @@ class SettingsController {
await this.db.updateAppSettings(req.body); await this.db.updateAppSettings(req.body);
const updatedSettings = { ...(await this.settingsService.reloadSettings()) }; const updatedSettings = { ...(await this.settingsService.reloadSettings()) };
delete updatedSettings.jwtSecret; delete updatedSettings.jwtSecret;
return res.status(200).json({ return res.successs({
success: true,
msg: successMessages.UPDATE_APP_SETTINGS, msg: successMessages.UPDATE_APP_SETTINGS,
data: updatedSettings, data: updatedSettings,
}); });