mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
fix payments
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user