Skip to content

Commit

Permalink
Merge pull request #163 from osu-tournament-rating/feature/leaderboar…
Browse files Browse the repository at this point in the history
…d-selected-mode

Leaderboard reflects selected gamemode
  • Loading branch information
hburn7 authored Apr 23, 2024
2 parents 4fb5eec + 04504f9 commit 3fc78fa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ export async function applyLeaderboardFilters(params: {}) {
export async function fetchLeaderboard(params: {}) {
const session = await getSession(true);

/* MISSING MODE, PLAYERID */
const osuMode =
(await cookies().get('OTR-user-selected-osu-mode')?.value) ?? '0';

/* PLAYERID */

const { type, page, rank, rating, matches, winrate, tiers } = params;

Expand Down Expand Up @@ -456,7 +459,7 @@ export async function fetchLeaderboard(params: {}) {
let backendString = new URLSearchParams(backendObject).toString();

let data = await fetch(
`${process.env.REACT_APP_API_URL}/leaderboards?${backendString}`,
`${process.env.REACT_APP_API_URL}/leaderboards?mode=${osuMode}&${backendString}`,
{
headers: {
'Content-Type': 'application/json',
Expand Down

0 comments on commit 3fc78fa

Please sign in to comment.