fix dashboard + payments

This commit is contained in:
Emily
2025-04-13 18:15:43 +02:00
parent 1d5dad44fa
commit 946f9d4d32
22 changed files with 272 additions and 521 deletions

View File

@@ -6,7 +6,6 @@ import { UserSettingsModel } from "@schema/UserSettings";
import { AiChatModel } from "@schema/ai/AiChatSchema";
import { LimitNotifyModel } from "@schema/broker/LimitNotifySchema";
import { SessionModel } from "@schema/metrics/SessionSchema";
import StripeService from "~/server/services/StripeService";
import { UserModel } from "@schema/UserSchema";
import { AddressBlacklistModel } from "~/shared/schema/shields/AddressBlacklistSchema";
import { DomainWhitelistModel } from "~/shared/schema/shields/DomainWhitelistSchema";
@@ -36,7 +35,7 @@ export default defineEventHandler(async event => {
const limitdeletation = await UserLimitModel.deleteMany({ user_id: userData.id });
const notifiesDeletation = await LimitNotifyModel.deleteMany({ user_id: userData.id });
await StripeService.deleteCustomer(premium.customer_id);
// await StripeService.deleteCustomer(premium.customer_id);
for (const project of projects) {
const project_id = project._id;
@@ -51,12 +50,11 @@ export default defineEventHandler(async event => {
const botTrafficOptionsDeletation = await BotTrafficOptionModel.deleteMany({ project_id });
const countryBlacklistDeletation = await CountryBlacklistModel.deleteMany({ project_id });
const domainWhitelistDeletation = await DomainWhitelistModel.deleteMany({ project_id });
const userDeletation = await UserModel.deleteOne({ _id: userData.id });
}
const userDeletation = await UserModel.deleteOne({ _id: userData.id });
return { ok: true };