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

+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;