add try/catch block

This commit is contained in:
Alex Holliday
2026-03-02 18:46:21 +00:00
parent c1e03a45b0
commit 64242322a2
+12 -8
View File
@@ -56,15 +56,19 @@ class SettingsController {
};
updateAppSettings = async (req: Request, res: Response, next: NextFunction) => {
updateAppSettingsBodyValidation.parse(req.body);
try {
updateAppSettingsBodyValidation.parse(req.body);
const updatedSettings = await this.settingsService.updateDbSettings(req.body);
const returnSettings = this.buildAppSettings(updatedSettings);
return res.status(200).json({
success: true,
msg: "App settings updated successfully",
data: returnSettings,
});
const updatedSettings = await this.settingsService.updateDbSettings(req.body);
const returnSettings = this.buildAppSettings(updatedSettings);
return res.status(200).json({
success: true,
msg: "App settings updated successfully",
data: returnSettings,
});
} catch (error) {
next(error);
}
};
sendTestEmail = async (req: Request, res: Response, next: NextFunction) => {