MCPcopy
hub / github.com/srcbookdev/srcbook / createSrcbook

Function createSrcbook

packages/web/src/lib/server.ts:37–52  ·  view source on GitHub ↗
(
  request: CreateSrcbookRequestType,
)

Source from the content-addressed store, hash-verified

35}
36
37export async function createSrcbook(
38 request: CreateSrcbookRequestType,
39): Promise<CreateSrcbookResponseType> {
40 const response = await fetch(API_BASE_URL + '/srcbooks', {
41 method: 'POST',
42 headers: { 'content-type': 'application/json' },
43 body: JSON.stringify(request),
44 });
45
46 if (!response.ok) {
47 console.error(response);
48 throw new Error('Request failed');
49 }
50
51 return response.json();
52}
53
54export async function deleteSrcbook(request: { id: string }) {
55 const response = await fetch(API_BASE_URL + '/srcbooks/' + request.id, {

Callers 2

onCreateSrcbookFunction · 0.90
onCreateSrcbookFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected