MCPcopy Create free account
hub / github.com/Lakr233/AssppWeb / apiPost

Function apiPost

frontend/src/api/client.ts:18–26  ·  view source on GitHub ↗
(path: string, body?: any)

Source from the content-addressed store, hash-verified

16}
17
18export async function apiPost<T>(path: string, body?: any): Promise<T> {
19 const res = await fetch(`${BASE_URL}${path}`, {
20 method: "POST",
21 headers: { "Content-Type": "application/json", ...authHeaders() },
22 body: body ? JSON.stringify(body) : undefined,
23 });
24 if (!res.ok) throw new Error(await res.text());
25 return res.json();
26}
27
28export async function apiDelete(path: string): Promise<void> {
29 const res = await fetch(`${BASE_URL}${path}`, {

Callers 5

startDownloadFunction · 0.90
pauseDownloadFunction · 0.90
resumeDownloadFunction · 0.90
startDownloadFunction · 0.90
client.test.tsFile · 0.90

Calls 4

fetchFunction · 0.85
authHeadersFunction · 0.85
textMethod · 0.80
jsonMethod · 0.80

Tested by

no test coverage detected