Skip to content

Commit 6576993

Browse files
committed
fix: do not include alumni in active student count
1 parent 4c74556 commit 6576993

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/utils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,11 @@ export const getAllCohorts = async function(prisma: PrismaClient): Promise<Cohor
282282
select: {
283283
begin_at: true,
284284
end_at: true,
285+
user: {
286+
select: {
287+
alumnized_at: true,
288+
},
289+
},
285290
},
286291
});
287292
const cohorts: Cohort[] = [];
@@ -291,7 +296,7 @@ export const getAllCohorts = async function(prisma: PrismaClient): Promise<Cohor
291296
const activeCursus = cursusUser.end_at === null || cursusUser.end_at > new Date();
292297
if (existingCohort) {
293298
existingCohort.user_count++;
294-
if (activeCursus) {
299+
if (activeCursus && !cursusUser.user.alumnized_at) {
295300
existingCohort.user_count_active++;
296301
}
297302
}

0 commit comments

Comments
 (0)