fix payments

This commit is contained in:
Emily
2024-06-11 23:01:54 +02:00
parent 7460ad5ed4
commit b7c3ef19ba
8 changed files with 101 additions and 124 deletions

View File

@@ -23,7 +23,9 @@ export default defineEventHandler(async event => {
if (project.premium === true) return setResponseStatus(event, 400, 'Cannot delete premium project');
await StripeService.deleteCustomer(project.customer_id);
if (project.customer_id) {
await StripeService.deleteCustomer(project.customer_id);
}
const projectDeletation = await ProjectModel.deleteOne({ _id: project_id });
const countDeletation = await ProjectCountModel.deleteMany({ project_id });