mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
1 parent
0817ba18bd
commit
0828d50830
5 files changed
+12
-32
No files matched your search
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user