MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / updateCredential

Function updateCredential

ui/src/api/config.ts:49–55  ·  view source on GitHub ↗
(slug: string, input: { vendor: string; label?: string; wires: Partial<Record<WireShape, string>>; apiKey?: string; lastModel?: string })

Source from the content-addressed store, hash-verified

47 },
48
49 async updateCredential(slug: string, input: { vendor: string; label?: string; wires: Partial<Record<WireShape, string>>; apiKey?: string; lastModel?: string }): Promise<void> {
50 const res = await fetch(`/api/config/credentials/${encodeURIComponent(slug)}`, { method: 'PUT', headers, body: JSON.stringify(input) })
51 if (!res.ok) {
52 const err = await res.json().catch(() => ({ error: 'Failed to update credential' }))
53 throw new Error(err.error || 'Failed to update credential')
54 }
55 },
56
57 async deleteCredential(slug: string): Promise<void> {
58 const res = await fetch(`/api/config/credentials/${encodeURIComponent(slug)}`, { method: 'DELETE' })

Callers

nothing calls this directly

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected