mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-25 07:03:05 +01:00
feat: start of mechanics
This commit is contained in:
1 parent
01409985a2
commit
da1af66c77
6 files changed
+37
-21
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import type { APIContext } from "astro";
|
||||
import { api } from "../../../core/api/dynamic";
|
||||
|
||||
export { getStaticPaths } from "./[id].pb";
|
||||
|
||||
/**
|
||||
* Even Noah can't save these animals.
|
||||
*/
|
||||
export async function GET({ params }: APIContext<never, { id: string }>) {
|
||||
const tank = await api.tank(params.id);
|
||||
return Response.json(tank);
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import { Tank } from "../../../protos/tank";
|
||||
|
||||
export const getStaticPaths = (async () => {
|
||||
const { list } = await api.tankList();
|
||||
|
||||
return list.map(({ id }) => ({ params: { id } }));
|
||||
}) satisfies GetStaticPaths;
|
||||
|
||||
|
||||
Reference in new issue
Block a user