diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-09-09 20:10:16 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-09-09 20:10:16 +0300 |
| commit | 188e806427ff6c9b302d994fc9c84a0300526688 (patch) | |
| tree | de6b28b307efc181a26ff422895246b25d70de8a /frontend/src/api | |
| parent | refactor: upload run form, lots of random shit (diff) | |
| download | lphub-188e806427ff6c9b302d994fc9c84a0300526688.tar.gz lphub-188e806427ff6c9b302d994fc9c84a0300526688.tar.bz2 lphub-188e806427ff6c9b302d994fc9c84a0300526688.zip | |
refactor: make names clickable throughout the site, fix user pages
Diffstat (limited to 'frontend/src/api')
| -rw-r--r-- | frontend/src/api/Api.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/frontend/src/api/Api.tsx b/frontend/src/api/Api.tsx index 1f77088..30c0ad6 100644 --- a/frontend/src/api/Api.tsx +++ b/frontend/src/api/Api.tsx | |||
| @@ -145,7 +145,17 @@ const get_map_leaderboard = async (map_id: string): Promise<MapLeaderboard | und | |||
| 145 | if (!response.data.success) { | 145 | if (!response.data.success) { |
| 146 | return undefined; | 146 | return undefined; |
| 147 | } | 147 | } |
| 148 | return response.data.data; | 148 | const data = response.data.data; |
| 149 | // map the kind of leaderboard | ||
| 150 | data.records = data.records.map((record: any) => { | ||
| 151 | if (record.host && record.partner) { | ||
| 152 | return { ...record, kind: 'multiplayer' }; | ||
| 153 | } else { | ||
| 154 | return { ...record, kind: 'singleplayer' }; | ||
| 155 | } | ||
| 156 | }); | ||
| 157 | // should be unreachable | ||
| 158 | return undefined; | ||
| 149 | }; | 159 | }; |
| 150 | 160 | ||
| 151 | // MAP DISCUSSIONS | 161 | // MAP DISCUSSIONS |