mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-11 16:28:37 +01:00
new selfhosted version
This commit is contained in:
16
dashboard/server/api/ai/delete_chat.ts
Normal file
16
dashboard/server/api/ai/delete_chat.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
import { AiNewChatModel } from "~/shared/schema/ai/AiNewChatSchema";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
const ctx = await getRequestContext(event, 'pid');
|
||||
const { project_id } = ctx;
|
||||
|
||||
const { chat_id } = getQuery(event);
|
||||
|
||||
const chat = await AiNewChatModel.updateOne({ _id: chat_id, project_id }, { deleted: true });
|
||||
if (!chat) return;
|
||||
|
||||
return chat;
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user