swap to ultra-fast APIs on homepage, finish continents

This commit is contained in:
41666 2023-06-09 12:55:24 -04:00
parent 644e25f673
commit 9b439d0a19
14 changed files with 365 additions and 114 deletions

15
app/utils/population.ts Normal file
View file

@ -0,0 +1,15 @@
export type PopulationWorld = {
id: number;
average: number;
factions: {
nc: number;
tr: number;
vs: number;
};
};
export const fetchPopulationWorlds = async (): Promise<PopulationWorld[]> => {
const response = await fetch("https://agg.ps2.live/population/all");
const data: PopulationWorld[] = await response.json();
return data.map(({ id, average, factions }) => ({ id, average, factions }));
};