swap to ultra-fast APIs on homepage, finish continents
This commit is contained in:
parent
644e25f673
commit
9b439d0a19
14 changed files with 365 additions and 114 deletions
15
app/utils/population.ts
Normal file
15
app/utils/population.ts
Normal 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 }));
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue