mirror of
https://github.com/Mintplex-Labs/anything-llm
synced 2026-04-27 09:57:18 +02:00
Feat/quick delete chat (#1302)
* feat:quick delete chat thread * update:pull request template * refactor bulk-deletion implementation * unset pull_request_changes * add border none for desktop support * unset marks when toggling bulk mode --------- Co-authored-by: timothycarambat <rambat1010@gmail.com>
This commit is contained in:
@@ -92,6 +92,29 @@ function workspaceThreadEndpoints(app) {
|
||||
}
|
||||
);
|
||||
|
||||
app.delete(
|
||||
"/workspace/:slug/thread-bulk-delete",
|
||||
[validatedRequest, flexUserRoleValid([ROLES.all]), validWorkspaceSlug],
|
||||
async (request, response) => {
|
||||
try {
|
||||
const { slugs = [] } = reqBody(request);
|
||||
if (slugs.length === 0) return response.sendStatus(200).end();
|
||||
|
||||
const user = await userFromSession(request, response);
|
||||
const workspace = response.locals.workspace;
|
||||
await WorkspaceThread.delete({
|
||||
slug: { in: slugs },
|
||||
user_id: user?.id ?? null,
|
||||
workspace_id: workspace.id,
|
||||
});
|
||||
response.sendStatus(200).end();
|
||||
} catch (e) {
|
||||
console.log(e.message, e);
|
||||
response.sendStatus(500).end();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
app.get(
|
||||
"/workspace/:slug/thread/:threadSlug/chats",
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user