fix(api): skip unavailable backend routes

This commit is contained in:
zetaloop
2026-04-25 14:04:53 +08:00
parent 54cd6d29fe
commit 70230483f8
2 changed files with 19 additions and 95 deletions
+2 -5
View File
@@ -36,9 +36,6 @@ export async function getPlayerById(playerId: string): Promise<Player | undefine
}
export async function listPlayersByShop(shopId: string): Promise<Player[]> {
const res = await httpJson<Paginated<Player>>(
`/api/v1/shops/${encodeURIComponent(shopId)}/players?offset=0&limit=100`,
{ cache: "no-store" },
)
return res.items
const players = await listPlayers()
return players.filter((player) => player.shopId === shopId)
}