mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-05 15:52:55 +01:00
feat: start of all tanks
This commit is contained in:
1 parent
53d05e73a6
commit
fcfc97b964
14 files changed
+174
-58
No files matched your search
@@ -0,0 +1,10 @@
|
||||
import { api } from "../../core/api/dynamic";
|
||||
import { Tanks } from "../../protos/tanks";
|
||||
|
||||
/**
|
||||
* Literally all the tanks in one place lmao.
|
||||
*/
|
||||
export async function GET() {
|
||||
const tanks = await api.tanks();
|
||||
return new Response(Tanks.encode(tanks).finish());
|
||||
}
|
||||
@@ -3,9 +3,9 @@ import { api } from "../../../core/api/dynamic";
|
||||
import { Tank } from "../../../protos/tank";
|
||||
|
||||
export const getStaticPaths = (async () => {
|
||||
const { tanks } = await api.tanks();
|
||||
const { list } = await api.tankList();
|
||||
|
||||
return tanks.map(({ id }) => ({ params: { id } }));
|
||||
return list.map(({ id }) => ({ params: { id } }));
|
||||
}) satisfies GetStaticPaths;
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user