feat: wire public posts api

This commit is contained in:
TerryM
2026-05-26 12:07:13 +08:00
parent f482a2ec38
commit d3c30795dc
19 changed files with 299 additions and 163 deletions

View File

@@ -44,6 +44,11 @@ export async function postJSON<T>(
return res.json() as Promise<T>;
}
export async function postNoBody(path: string): Promise<void> {
const res = await fetch(`${apiBase}${path}`, { method: "POST" });
if (!res.ok) throw new Error(await res.text());
}
export async function putJSON<T>(
path: string,
body: unknown,