|
1 | 1 | import { PrismaClient } from '@prisma/client'; |
2 | 2 | import { Express } from 'express'; |
3 | | -import { getEndedSeasons, getSeasonResults, RANKING_MAX } from '../utils'; |
| 3 | +import { getEndedSeasons, getSeasonName, getSeasonResults, RANKING_MAX } from '../utils'; |
4 | 4 |
|
5 | 5 | export const setupResultsRoutes = function(app: Express, prisma: PrismaClient): void { |
6 | 6 | app.get('/results', async (req, res) => { |
@@ -45,13 +45,13 @@ export const setupResultsRoutes = function(app: Express, prisma: PrismaClient): |
45 | 45 |
|
46 | 46 | return res.render('ranking.njk', { |
47 | 47 | pageranking: seasonResult.scores.map((entry, index) => ({ // Transform to match ranking.njk expected format |
48 | | - rankingName: `${seasonResult.coalition.intra_coalition.name} Leaderboards - Season ${season.id}`, |
| 48 | + rankingName: `${seasonResult.coalition.intra_coalition.name} Leaderboards - Season ${getSeasonName(season)}`, |
49 | 49 | user: entry.user.intra_user, |
50 | 50 | coalition: seasonResult.coalition, |
51 | 51 | score: entry.score, |
52 | 52 | rank: entry.coalition_rank, |
53 | 53 | })), |
54 | | - rankingTitle: `${seasonResult.coalition.intra_coalition.name} Leaderboards - Season ${season.id}`, |
| 54 | + rankingTitle: `${seasonResult.coalition.intra_coalition.name} Leaderboards - Season ${getSeasonName(season)}`, |
55 | 55 | coalitionColored: false, |
56 | 56 | }); |
57 | 57 | }); |
@@ -101,7 +101,7 @@ export const setupResultsRoutes = function(app: Express, prisma: PrismaClient): |
101 | 101 | score: entry.score, |
102 | 102 | rank: entry.rank, |
103 | 103 | })), |
104 | | - rankingTitle: `${ranking.name} - Season ${season.id}`, |
| 104 | + rankingTitle: `${ranking.name} - Season ${getSeasonName(season)}`, |
105 | 105 | rankingDescription: ranking.description, |
106 | 106 | coalitionColored: true, |
107 | 107 | }); |
|
0 commit comments