reintroduce newsletter config

This commit is contained in:
Julian Krauser 2025-02-05 10:22:51 +01:00
parent 2ce56a49bb
commit 3f3ad9ca58
4 changed files with 58 additions and 9 deletions

View file

@ -2,7 +2,10 @@ import { Request, Response } from "express";
import NewsletterConfigService from "../../../service/settings/newsletterConfigService";
import NewsletterConfigFactory from "../../../factory/admin/settings/newsletterConfig";
import NewsletterConfigCommandHandler from "../../../command/settings/newsletterConfig/newsletterConfigCommandHandler";
import { SetNewsletterConfigCommand } from "../../../command/settings/newsletterConfig/newsletterConfigCommand";
import {
DeleteNewsletterConfigCommand,
SetNewsletterConfigCommand,
} from "../../../command/settings/newsletterConfig/newsletterConfigCommand";
/**
* @description get all newsletterConfigs
@ -43,7 +46,24 @@ export async function setNewsletterConfig(req: Request, res: Response): Promise<
comTypeId,
config,
};
let id = await NewsletterConfigCommandHandler.set(createNewsletterConfig);
await NewsletterConfigCommandHandler.set(createNewsletterConfig);
res.send(id);
res.sendStatus(204);
}
/**
* @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);
}