feat: code split a lot

This commit is contained in:
TrèsAbhi committed 2023-10-11 18:42:36 -05:00
1 parent 78e4c82f20
commit d2668974f7
18 files changed
+155 -133

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
import { Region } from '../../constants/regions';
import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID';
import { AccountInfo } from '../../types/accountInfo';
import getWargamingResponse from './getWargamingResponse';
// BIG TODO: generalize all get wargaming calls
export function getAccountInfo(region: Region, id: number) {
return getWargamingResponse<AccountInfo>(
`https://api.wotblitz.${region}/wotb/account/info/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${id}`,
);
}
+3
View File
@@ -0,0 +1,3 @@
export function getClanLogo(emblemId: number) {
return `https://wotblitz-gc.gcdn.co/icons/clanEmblems1x/clan-icon-v2-${emblemId}.png`
}
+10
View File
@@ -0,0 +1,10 @@
import { Region } from '../../constants/regions';
import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID';
import { PlayerClanInfo } from '../../types/playerClanData';
import getWargamingResponse from './getWargamingResponse';
export function playerClanInfo(region: Region, id: number) {
return getWargamingResponse<PlayerClanInfo>(
`https://api.wotblitz.${region}/wotb/clans/accountinfo/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${id}&extra=clan`,
);
}