diff --git a/src/factory/admin/memberQualification.ts b/src/factory/admin/memberQualification.ts index b877b8b..290b2bb 100644 --- a/src/factory/admin/memberQualification.ts +++ b/src/factory/admin/memberQualification.ts @@ -13,6 +13,7 @@ export default abstract class MemberQualificationFactory { note: record.note, start: record.start, end: record.end, + terminationReason: record.terminationReason, qualification: record.qualification.qualification, }; } diff --git a/src/service/memberService.ts b/src/service/memberService.ts index 842ef98..ae9e2d4 100644 --- a/src/service/memberService.ts +++ b/src/service/memberService.ts @@ -26,13 +26,13 @@ export default abstract class MemberService { ) .leftJoinAndSelect("membership_first.status", "status_first") .leftJoinAndSelect("membership_last.status", "status_last") - .leftJoinAndSelect("member.sendNewsletter", "communication") - .leftJoinAndSelect("communication.type", "communicationtype") + .leftJoinAndSelect("member.sendNewsletter", "sendNewsletter") + .leftJoinAndSelect("sendNewsletter.type", "communicationtype") .leftJoinAndMapMany( "member.preferredCommunication", "member.communications", "preferredCommunication", - "preferredCommunication.preferred = TRUE" + "preferredCommunication.preferred = 1" ) .leftJoinAndSelect("preferredCommunication.type", "communicationtype_preferred") .offset(offset) @@ -72,6 +72,15 @@ export default abstract class MemberService { ) .leftJoinAndSelect("membership_first.status", "status_first") .leftJoinAndSelect("membership_last.status", "status_last") + .leftJoinAndSelect("member.sendNewsletter", "sendNewsletter") + .leftJoinAndSelect("sendNewsletter.type", "communicationtype") + .leftJoinAndMapMany( + "member.preferredCommunication", + "member.communications", + "preferredCommunication", + "preferredCommunication.preferred = 1" + ) + .leftJoinAndSelect("preferredCommunication.type", "communicationtype_preferred") .where("member.id = :id", { id: id }) .getOneOrFail() .then((res) => {