fix: exclude disabled users

This commit is contained in:
Ephraim Atta-Duncan
2025-01-28 15:57:15 +00:00
parent 97f7d77a34
commit d7f7cbf27f

View File

@ -100,7 +100,7 @@ export const getMonthlyActiveUsers = async () => {
COUNT(DISTINCT "id") as "count",
SUM(COUNT(DISTINCT "id")) OVER (ORDER BY DATE_TRUNC('month', "lastSignedIn")) as "cume_count"
FROM "User"
WHERE "lastSignedIn" >= NOW() - INTERVAL '1 year'
WHERE "lastSignedIn" >= NOW() - INTERVAL '1 year' AND "disabled" = false
GROUP BY DATE_TRUNC('month', "lastSignedIn")
ORDER BY "month" DESC
LIMIT 12