mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
fix function calling + add clear all on chats
This commit is contained in:
13
dashboard/server/api/ai/delete_all_chats.ts
Normal file
13
dashboard/server/api/ai/delete_all_chats.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
import { AiChatModel } from "@schema/ai/AiChatSchema";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
const data = await getRequestData(event);
|
||||
if (!data) return;
|
||||
|
||||
const { project_id } = data;
|
||||
|
||||
const result = await AiChatModel.updateMany({ project_id }, { deleted: true });
|
||||
return result.modifiedCount > 0;
|
||||
});
|
||||
Reference in New Issue
Block a user