feat: wire public posts api
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user