From c173f917e38550da53be4e748368ebf3dfec038f Mon Sep 17 00:00:00 2001 From: Julian Krauser Date: Fri, 10 Jan 2025 11:26:48 +0100 Subject: [PATCH] fix: possibly undefined newsletter com --- src/controller/admin/club/memberController.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/controller/admin/club/memberController.ts b/src/controller/admin/club/memberController.ts index dacbbae..807a911 100644 --- a/src/controller/admin/club/memberController.ts +++ b/src/controller/admin/club/memberController.ts @@ -48,8 +48,8 @@ import { UpdateCommunicationCommand, } from "../../../command/club/member/communicationCommand"; import CommunicationCommandHandler from "../../../command/club/member/communicationCommandHandler"; -import {PdfExport} from "../../../helpers/pdfExport"; -import {PermissionModule} from "../../../type/permissionTypes"; +import { PdfExport } from "../../../helpers/pdfExport"; +import { PermissionModule } from "../../../type/permissionTypes"; /** * @description get all members @@ -227,14 +227,14 @@ export async function getCommunicationByMemberAndRecord(req: Request, res: Respo * @returns {Promise<*>} */ export async function createMemberPrintoutList(req: Request, res: Response): Promise { - 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); }