feat: less spamming api

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
TrèsAbhiandCopilot committed 2026-04-27 14:39:47 -05:00
1 parent 0817ba18bd
commit 0828d50830
5 files changed
+12 -32

No files matched your search

+6 -5
View File
@@ -2,8 +2,8 @@ import { fetchPB } from "@blitzkit/core";
import type { Strings } from "@blitzkit/i18n";
import { Avatars } from "@protos/blitzkit/avatars";
import { PopularTanks } from "@protos/blitzkit/popular_tanks";
import { Tank } from "@protos/blitzkit/tank";
import { TankList } from "@protos/blitzkit/tank_list";
import { Tanks } from "@protos/blitzkit/tanks";
import { AbstractAPI, Cache } from "./abstract";
const rejected = Promise.reject("Not implemented on client");
@@ -15,13 +15,14 @@ export class ClientAPI extends AbstractAPI {
}
@Cache()
tank(id: string) {
return fetchPB(`/api/tanks/${id}.pb`, Tank);
async tank(id: string) {
const tanks = await this.tanks();
return tanks.tanks[id];
}
@UnimplementedOnClient
@Cache()
tanks() {
return rejected;
return fetchPB("/api/tanks/all.pb", Tanks);
}
@Cache()