From 1126c355dae522af6f8382666fbe4d9c8f72b8fe Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Jun 2025 12:27:52 +0200 Subject: [PATCH] api changes --- src/app/lib/utils.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/lib/utils.ts b/src/app/lib/utils.ts index 84e87d8..9c38361 100644 --- a/src/app/lib/utils.ts +++ b/src/app/lib/utils.ts @@ -87,10 +87,10 @@ export async function fetchSummoner ( puuid: string ) return res.json(); } -export async function fetchRankedStats ( summonerId: string ) +export async function fetchRankedStats ( puuid: string ) { const res = await fetch( - `https://${ REGION }.api.riotgames.com/lol/league/v4/entries/by-summoner/${ summonerId }`, + `https://${ REGION }.api.riotgames.com/lol/league/v4/entries/by-puuid/${ puuid }`, { headers } ); if ( !res.ok ) return {}; @@ -177,10 +177,9 @@ export async function fetchMatches ( puuid: string ) export async function getRankedData ( name: string, tag: string ) { const account = await fetchAccount( name, tag ); - const summoner = await fetchSummoner( account.puuid ); const [ matches, rankedStats ] = await Promise.all( [ fetchSixMatches( account.puuid ), - fetchRankedStats( summoner.id ), + fetchRankedStats( account.puuid ), ] ); return { ...rankedStats, matches }; @@ -195,7 +194,7 @@ export async function getSessionData ( name: string, tag: string ) const summoner = await fetchSummoner( account.puuid ); const [ matches, rankedStats ] = await Promise.all( [ fetchMatches( account.puuid ), - fetchRankedStats( summoner.id ), + fetchRankedStats( account.puuid ), ] ); const recentMatches = matches.filter( ( match ) => !match.isOld );