2024-11-20 10:26:55 -06:00
|
|
|
// import { Region } from '@blitzkit/core';
|
|
|
|
|
// import { context } from '../blitzkit/context';
|
|
|
|
|
// import { patientFetch } from '../blitzkit/patientFetch';
|
|
|
|
|
// import { regionToRegionSubdomain } from './regionToRegionSubdomain';
|
2023-08-09 17:20:03 +00:00
|
|
|
|
2024-11-20 10:26:55 -06:00
|
|
|
// const cache: Partial<Record<Region, RatingInfo>> = {};
|
2024-01-19 16:02:03 -06:00
|
|
|
|
2024-11-20 10:26:55 -06:00
|
|
|
// export async function getRatingInfo(region: Region) {
|
|
|
|
|
// if (cache[region]) return cache[region]!;
|
2024-01-19 16:02:03 -06:00
|
|
|
|
2024-11-20 10:26:55 -06:00
|
|
|
// const response = await patientFetch(
|
|
|
|
|
// context === 'website'
|
|
|
|
|
// ? `/api/${region}/rating/current/info`
|
|
|
|
|
// : `https://${regionToRegionSubdomain(
|
|
|
|
|
// region,
|
|
|
|
|
// )}.wotblitz.com/en/api/rating-leaderboards/season/`,
|
|
|
|
|
// undefined,
|
|
|
|
|
// );
|
|
|
|
|
// const data = (await response.json()) as RatingInfo;
|
2023-09-03 18:15:10 +00:00
|
|
|
|
2024-11-20 10:26:55 -06:00
|
|
|
// cache[region] = data;
|
2024-01-19 16:02:03 -06:00
|
|
|
|
2024-11-20 10:26:55 -06:00
|
|
|
// return data;
|
|
|
|
|
// }
|