MCPcopy Create free account
hub / github.com/triggerdotdev/jsonhero-web / updateDocument

Function updateDocument

app/jsonDoc.server.ts:116–129  ·  view source on GitHub ↗
(
  slug: string,
  title: string
)

Source from the content-addressed store, hash-verified

114}
115
116export async function updateDocument(
117 slug: string,
118 title: string
119): Promise<JSONDocument | undefined> {
120 const document = await getDocument(slug);
121
122 if (!document) return;
123
124 const updated = { ...document, title };
125
126 await DOCUMENTS.put(slug, JSON.stringify(updated));
127
128 return updated;
129}
130
131export async function deleteDocument(slug: string): Promise<void> {
132 await DOCUMENTS.delete(slug);

Callers 1

actionFunction · 0.90

Calls 1

getDocumentFunction · 0.85

Tested by

no test coverage detected