MCPcopy Create free account
hub / github.com/6174/comflowyspace / createDocument

Method createDocument

packages/common/jsondb/jsondb.client.ts:25–34  ·  view source on GitHub ↗
(id: string, data: T)

Source from the content-addressed store, hash-verified

23 }
24
25 async createDocument(id: string, data: T): Promise<JSONDBReponse> {
26 const response = await fetch(getBackendUrl(`/db/collection/${this.collectionName}/${id}`), {
27 method: 'POST',
28 headers: {
29 'Content-Type': 'application/json',
30 },
31 body: JSON.stringify(data),
32 });
33 return response.json();
34 }
35
36 /**
37 * Get all documents

Callers 1

createDocMethod · 0.80

Calls 1

getBackendUrlFunction · 0.90

Tested by

no test coverage detected