fix function calling + add clear all on chats

This commit is contained in:
Emily
2024-12-17 16:25:27 +01:00
parent 0a9474d00c
commit 68d362d1b3
6 changed files with 174 additions and 82 deletions

View 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;
});