email config
This commit is contained in:
1 parent
60153a88e2
commit
af6fede1b3
7 files changed
+179
-61
No files matched your search
@@ -4,7 +4,11 @@ import { NotificationService, SettingsService } from "@/services/index.js";
|
||||
|
||||
export interface ISettingsController {
|
||||
get: (req: Request, res: Response, next: NextFunction) => void;
|
||||
update: (req: Request, res: Response, next: NextFunction) => void;
|
||||
updateEmailSettings: (
|
||||
req: Request,
|
||||
res: Response,
|
||||
next: NextFunction
|
||||
) => void;
|
||||
testTransport: (req: Request, res: Response, next: NextFunction) => void;
|
||||
}
|
||||
|
||||
@@ -31,11 +35,17 @@ class SettingsController implements ISettingsController {
|
||||
}
|
||||
};
|
||||
|
||||
update = async (req: Request, res: Response, next: NextFunction) => {
|
||||
updateEmailSettings = async (
|
||||
req: Request,
|
||||
res: Response,
|
||||
next: NextFunction
|
||||
) => {
|
||||
try {
|
||||
const updatedSettings = await this.settingsService.update(req.body);
|
||||
const updatedSettings = await this.settingsService.updateEmailSettings(
|
||||
req.body
|
||||
);
|
||||
res.status(200).json({
|
||||
message: "Settings updated successfully",
|
||||
message: "Email settings updated successfully",
|
||||
data: updatedSettings,
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
Reference in new issue
Block a user