fix: possibly undefined newsletter com

This commit is contained in:
Julian Krauser 2025-01-10 11:26:48 +01:00
parent 55d4a952c3
commit c173f917e3

View file

@ -227,14 +227,14 @@ export async function getCommunicationByMemberAndRecord(req: Request, res: Respo
* @returns {Promise<*>}
*/
export async function createMemberPrintoutList(req: Request, res: Response): Promise<any> {
let members = await MemberService.getByRunningMembership()
let members = await MemberService.getByRunningMembership();
let pdf = await PdfExport.renderFile({
title: "Mitgliederliste",
template: "member.list",
saveToDisk: false,
data: {
member: members
member: members,
},
});
@ -596,7 +596,7 @@ export async function updateCommunicationOfMember(req: Request, res: Response):
communicationId: recordId,
};
await MemberCommandHandler.updateNewsletter(updateNewsletter);
} else if (currentUserNewsletterMain.sendNewsletter.id == recordId) {
} else if (currentUserNewsletterMain.sendNewsletter?.id == recordId) {
await MemberCommandHandler.unsetNewsletter(memberId);
}