7?
Some checks failed
Deploy Website / deploy (push) Failing after 1m36s
Deploy Backend / deploy (push) Successful in 3m11s

This commit is contained in:
Lee
2024-10-17 15:47:20 +01:00
parent e37f0d5548
commit d08f81b25d
6 changed files with 11 additions and 13 deletions

View File

@ -1,12 +1,11 @@
import { Metadata } from "../types/metadata";
import { BeatSaverMap } from "../model/beatsaver/beatsaver-map";
import Score from "../score/score";
export default interface LeaderboardScoresResponse<L> {
export default interface LeaderboardScoresResponse<S, L> {
/**
* The scores that were set.
*/
readonly scores: Score[];
readonly scores: S[];
/**
* The leaderboard that was used.

View File

@ -3,6 +3,7 @@ import { kyFetch } from "./utils";
import PlayerScoresResponse from "../response/player-scores-response";
import { Config } from "../config";
import { ScoreSort } from "../score/score-sort";
import LeaderboardScoresResponse from "../response/leaderboard-scores-response";
/**
* Fetches the player's scores
@ -33,5 +34,5 @@ export async function fetchPlayerScores<S, L>(
* @param page the page
*/
export async function fetchLeaderboardScores<S, L>(leaderboard: Leaderboards, id: string, page: number) {
return kyFetch<PlayerScoresResponse<S, L>>(`${Config.apiUrl}/scores/leaderboard/${leaderboard}/${id}/${page}`);
return kyFetch<LeaderboardScoresResponse<S, L>>(`${Config.apiUrl}/scores/leaderboard/${leaderboard}/${id}/${page}`);
}