extend newstellter config

This commit is contained in:
Julian Krauser 2024-12-26 12:04:12 +01:00
parent 7d36ed3121
commit 4180da5749
4 changed files with 51 additions and 4 deletions

View file

@ -2,7 +2,7 @@ import { Request, Response } from "express";
import NewsletterConfigService from "../../service/newsletterConfigService";
import NewsletterConfigFactory from "../../factory/admin/newsletterConfig";
import NewsletterConfigCommandHandler from "../../command/newsletterConfigCommandHandler";
import { SetNewsletterConfigCommand } from "../../command/newsletterConfigCommand";
import { DeleteNewsletterConfigCommand, SetNewsletterConfigCommand } from "../../command/newsletterConfigCommand";
/**
* @description get all newsletterConfigs
@ -43,7 +43,24 @@ export async function setNewsletterConfig(req: Request, res: Response): Promise<
comTypeId,
config,
};
let id = await NewsletterConfigCommandHandler.setConfig(createNewsletterConfig);
let id = await NewsletterConfigCommandHandler.set(createNewsletterConfig);
res.send(id);
}
/**
* @description delete award
* @param req {Request} Express req object
* @param res {Response} Express res object
* @returns {Promise<*>}
*/
export async function deleteNewsletterConfig(req: Request, res: Response): Promise<any> {
const comTypeId = parseInt(req.params.comTypeId);
let deleteNewsletterConfig: DeleteNewsletterConfigCommand = {
comTypeId: comTypeId,
};
await NewsletterConfigCommandHandler.delete(deleteNewsletterConfig);
res.sendStatus(204);
}