MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / del

Function del

src/services/utils/http.ts:147–158  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

145}
146
147export async function del<T = boolean>(path: string): Promise<T> {
148 const resp = await fetch(`${_baseUrl}${path}`, {
149 method: 'DELETE',
150 headers: getAuthHeaders(),
151 })
152 handle401(resp)
153 if (!resp.ok) {
154 const text = await resp.text().catch(() => '')
155 throw new Error(`HTTP ${resp.status}: ${text}`)
156 }
157 return resp.json() as Promise<T>
158}
159
160export async function put<T>(path: string, body?: unknown): Promise<T> {
161 const hasBody = body !== undefined

Callers 6

deleteConfigMethod · 0.90
deleteCustomProviderMethod · 0.90
deleteCustomModelMethod · 0.90
deleteMethod · 0.90
deleteAIChatMethod · 0.90
deleteMethod · 0.90

Calls 3

getAuthHeadersFunction · 0.85
handle401Function · 0.85
textMethod · 0.80

Tested by

no test coverage detected