MCPcopy Create free account
hub / github.com/PromtEngineer/localGPT / deleteSession

Method deleteSession

src/lib/api.ts:240–256  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

238 }
239
240 async deleteSession(sessionId: string): Promise<{ message: string; deleted_session_id: string }> {
241 try {
242 const response = await fetch(`${API_BASE_URL}/sessions/${sessionId}`, {
243 method: 'DELETE',
244 });
245
246 if (!response.ok) {
247 const errorData = await response.json().catch(() => ({ error: 'Unknown error' }));
248 throw new Error(`Delete session error: ${errorData.error || response.statusText}`);
249 }
250
251 return await response.json();
252 } catch (error) {
253 console.error('Delete session failed:', error);
254 throw error;
255 }
256 }
257
258 async renameSession(sessionId: string, newTitle: string): Promise<{ message: string; session: ChatSession }> {
259 try {

Callers 1

handleDeleteSessionFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected