mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
feat: add bulk delete for session manager (#1693)
* feat: add bulk delete for session manager * fix: address batch delete review issues * fix: keep session list in sync after batch delete
This commit is contained in:
@@ -129,6 +129,29 @@ export const handlers = [
|
||||
return success(deleteSession(providerId, sessionId, sourcePath));
|
||||
}),
|
||||
|
||||
http.post(`${TAURI_ENDPOINT}/delete_sessions`, async ({ request }) => {
|
||||
const { items = [] } = await withJson<{
|
||||
items?: {
|
||||
providerId: string;
|
||||
sessionId: string;
|
||||
sourcePath: string;
|
||||
}[];
|
||||
}>(request);
|
||||
|
||||
return success(
|
||||
items.map((item) => ({
|
||||
providerId: item.providerId,
|
||||
sessionId: item.sessionId,
|
||||
sourcePath: item.sourcePath,
|
||||
success: deleteSession(
|
||||
item.providerId,
|
||||
item.sessionId,
|
||||
item.sourcePath,
|
||||
),
|
||||
})),
|
||||
);
|
||||
}),
|
||||
|
||||
// MCP APIs
|
||||
http.post(`${TAURI_ENDPOINT}/get_mcp_config`, async ({ request }) => {
|
||||
const { app } = await withJson<{ app: AppId }>(request);
|
||||
|
||||
Reference in New Issue
Block a user