fix account delete

This commit is contained in:
Emily
2024-12-27 15:39:28 +01:00
parent cb928977c3
commit 46bca2f787

View File

@@ -7,6 +7,7 @@ import { AiChatModel } from "@schema/ai/AiChatSchema";
import { LimitNotifyModel } from "@schema/broker/LimitNotifySchema"; import { LimitNotifyModel } from "@schema/broker/LimitNotifySchema";
import { SessionModel } from "@schema/metrics/SessionSchema"; import { SessionModel } from "@schema/metrics/SessionSchema";
import StripeService from "~/server/services/StripeService"; import StripeService from "~/server/services/StripeService";
import { UserModel } from "@schema/UserSchema";
export default defineEventHandler(async event => { export default defineEventHandler(async event => {
@@ -29,6 +30,8 @@ export default defineEventHandler(async event => {
const notifiesDeletation = await LimitNotifyModel.deleteMany({ project_id }); const notifiesDeletation = await LimitNotifyModel.deleteMany({ project_id });
const aiChatsDeletation = await AiChatModel.deleteMany({ project_id }); const aiChatsDeletation = await AiChatModel.deleteMany({ project_id });
const userDeletation = await UserModel.deleteOne({ _id: userData.id });
} }
return { ok: true }; return { ok: true };