From 828a6f7e67474a37f38f46c4302eb7e70c4ec6cc Mon Sep 17 00:00:00 2001 From: Freek Bes <36384333+FreekBes@users.noreply.github.com> Date: Mon, 4 Nov 2024 23:58:56 +0100 Subject: [PATCH] fix: order rankings by type --- src/dev/create_rankings.ts | 2 +- src/routes/admin/rankings.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dev/create_rankings.ts b/src/dev/create_rankings.ts index 71977c4..3381005 100644 --- a/src/dev/create_rankings.ts +++ b/src/dev/create_rankings.ts @@ -28,7 +28,7 @@ const createRanking = async function(name: string, description: string, topTitle const createRankings = async function(): Promise { await createRanking('Guiding Stars', 'Based on points gained through evaluations', 'Guiding Star', 100000, ['evaluation']); - await createRanking('Top Performers', 'Based on points gained through projects', 'Top Performer', 100000, ['project']); + await createRanking('Top Performers', 'Based on points gained through projects', 'Top Performer', 100000, ['project', 'exam']); await createRanking('Top Endeavors', 'Based on points gained through logtime', 'Top Endeavor', 100000, ['logtime']); await createRanking('Philanthropists', 'Based on points gained through donating evaluation points to the pool', 'Philanthropist', 100000, ['point_donated']); await createRanking('Community Leaders', 'Based on points gained through organizing events', 'Community Leader', 100000, ['event_basic', 'event_intermediate', 'event_advanced']); diff --git a/src/routes/admin/rankings.ts b/src/routes/admin/rankings.ts index 6849335..80033b3 100644 --- a/src/routes/admin/rankings.ts +++ b/src/routes/admin/rankings.ts @@ -7,6 +7,9 @@ export const setupAdminRankingRoutes = function(app: Express, prisma: PrismaClie include: { fixed_types: true, }, + orderBy: { + type: 'asc', + }, }); res.render('admin/rankings.njk', { rankings,