update newsletter syncing commands and controller
This commit is contained in:
parent
4180da5749
commit
6dcd650cad
9 changed files with 16 additions and 49 deletions
|
@ -215,14 +215,11 @@ export async function synchronizeNewsletterDatesById(req: Request, res: Response
|
|||
*/
|
||||
export async function synchronizeNewsletterRecipientsById(req: Request, res: Response): Promise<any> {
|
||||
let newsletterId = parseInt(req.params.newsletterId);
|
||||
let recipients = req.body.recipients as Array<NewsletterRecipientsViewModel>;
|
||||
let recipients = req.body.recipients as Array<number>;
|
||||
|
||||
let syncRecipients: SynchronizeNewsletterRecipientsCommand = {
|
||||
newsletterId,
|
||||
recipients: recipients.map((r) => ({
|
||||
memberId: r.memberId,
|
||||
addedManually: r.addedManually,
|
||||
})),
|
||||
recipients: recipients,
|
||||
};
|
||||
await NewsletterRecipientsCommandHandler.sync(syncRecipients);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue