fix: more imports 2

This commit is contained in:
TrèsAbhi committed 2024-09-08 10:15:42 -05:00
1 parent 4f24db0956
commit c51ddbc725
49 files changed
+138 -123

No files matched your search

@@ -0,0 +1,26 @@
import { RatingNeighbors, Region } from '@blitzkit/core';
import { regionToRegionSubdomain } from '../../../website/src/core/blitz/regionToRegionSubdomain';
import { patientFetch } from '../../../website/src/core/blitzkit/patientFetch';
import { withCORSProxy } from '../../../website/src/core/blitzkit/withCORSProxy';
export async function getRatingNeighbors(
region: Region,
id: number,
count: number,
usePatientFetcher = false,
) {
const fetcher = (url: string) =>
usePatientFetcher
? patientFetch(url, undefined, { cache: 'no-store' })
: fetch(url, { cache: 'no-store' });
const response = await fetcher(
withCORSProxy(
`https://${regionToRegionSubdomain(
region,
)}.wotblitz.com/en/api/rating-leaderboards/user/${id}/?neighbors=${count}`,
),
);
const json = (await response.json()) as RatingNeighbors;
return json;
}