feat: removed non-proxy apis

This commit is contained in:
TrèsAbhi committed 2023-09-23 19:20:29 -05:00
1 parent 925ac96264
commit 6ff2a23ff7
11 files changed
+54 -65

No files matched your search

+2 -2
View File
@@ -1,11 +1,11 @@
import { REGION_NAMES, Region } from '../../constants/regions';
import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID';
import { TankStats } from '../../types/tanksStats';
import { TanksStats } from '../../types/tanksStats';
import throwError from '../node/throwError';
import getWargamingResponse from './getWargamingResponse';
export default async function getTankStats(region: Region, id: number) {
const tankStats = await getWargamingResponse<TankStats>(
const tankStats = await getWargamingResponse<TanksStats>(
`https://api.wotblitz.${region}/wotb/tanks/stats/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${id}`,
);
+6 -2
View File
@@ -22,8 +22,12 @@ export interface Tankopedia {
}
console.log('Caching tankopedia...');
export const tankopedia = fetch('https://www.blitzstars.com/bs-tankopedia.json')
.then((response) => response.json())
export const tankopedia = fetch(
typeof window === 'undefined'
? 'https://www.blitzstars.com/bs-tankopedia.json'
: '/api/tankopedia',
)
.then(async (response) => response.json())
.then((wrapperTankopedia) => {
console.log('Tankopedia cached');
return (wrapperTankopedia as { data: Tankopedia }).data;