fix: member sorting at active members

This commit is contained in:
Julian Krauser 2025-01-08 18:09:22 +01:00
parent a968c6af25
commit 03cc0f02b7

View file

@ -120,17 +120,20 @@ export default abstract class MemberService {
*/ */
static async getByRunningMembership(): Promise<Array<member>> { static async getByRunningMembership(): Promise<Array<member>> {
return await dataSource return await dataSource
.getRepository(member) .getRepository(member)
.createQueryBuilder("member") .createQueryBuilder("member")
.leftJoinAndSelect("member.memberships", "membership") .leftJoinAndSelect("member.memberships", "membership")
.where("membership.end IS NULL") .where("membership.end IS NULL")
.getMany() .orderBy("member.lastname")
.then((res) => { .addOrderBy("member.firstname")
return res; .addOrderBy("member.nameaffix")
}) .getMany()
.catch((err) => { .then((res) => {
throw new InternalException("member not found by id", err); return res;
}); })
.catch((err) => {
throw new InternalException("member not found by id", err);
});
} }
/** /**