MCPcopy Create free account
hub / github.com/aptabase/aptabase / _fetch

Function _fetch

src/webapp/fns/api.ts:36–44  ·  view source on GitHub ↗
(method: string, path: string, body?: any)

Source from the content-addressed store, hash-verified

34};
35
36async function _fetch(method: string, path: string, body?: any): Promise<[number, Response]> {
37 const response = await window.fetch(`/api${path}`, {
38 ...(method === "GET" ? commonHeaders : mutatingHeaders),
39 method,
40 body: body ? JSON.stringify(body) : undefined,
41 });
42
43 return [response.status, response];
44}
45
46async function get<T>(path: string, params?: Record<string, any>): Promise<T> {
47 const paramsStr = params ? new URLSearchParams(params).toString() : "";

Callers 5

getFunction · 0.85
postFunction · 0.85
putFunction · 0.85
_deleteFunction · 0.85
getEmptyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected