From 3503110c64e452297d8a58fe4ebf181f3326cdac Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Wed, 11 Mar 2026 12:12:21 +0100 Subject: [PATCH] Do not show cancelled events --- backend/api/src/stats.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/api/src/stats.ts b/backend/api/src/stats.ts index 526b57e7..3e67cb85 100644 --- a/backend/api/src/stats.ts +++ b/backend/api/src/stats.ts @@ -24,7 +24,9 @@ export const stats: APIHandler<'stats'> = async (_, _auth) => { const [userCount, profileCount, eventsCount, messagesCount, genderStats] = await Promise.all([ pg.one(`SELECT COUNT(*)::int as count FROM users`), pg.one(`SELECT COUNT(*)::int as count FROM profiles`), - pg.one(`SELECT COUNT(*)::int as count FROM events WHERE event_start_time > now()`), + pg.one( + `SELECT COUNT(*)::int as count FROM events WHERE event_start_time > now() and status = 'active'`, + ), getMessagesCount(), pg.manyOrNone( `SELECT gender, COUNT(*)::int as count FROM profiles WHERE gender IS NOT NULL GROUP BY gender`,