MCPcopy Index your code
hub / github.com/srcbookdev/srcbook / createSecret

Function createSecret

packages/web/src/lib/server.ts:291–302  ·  view source on GitHub ↗
(request: CreateSecretRequestType)

Source from the content-addressed store, hash-verified

289}
290
291export async function createSecret(request: CreateSecretRequestType) {
292 const response = await fetch(API_BASE_URL + '/secrets', {
293 method: 'POST',
294 headers: { 'content-type': 'application/json' },
295 body: JSON.stringify(request),
296 });
297 if (!response.ok) {
298 console.error(response);
299 throw new Error('Request for creating a secret failed');
300 }
301 return response.json();
302}
303
304interface UpdateSecretRequestType {
305 previousName: string;

Callers 2

onSubmitFunction · 0.90
onSubmitFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected