The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
combine into 1 call
Steven Teyf0249b1133e8
diff --git a/apps/web/app/(ee)/api/stripe/webhook/charge-failed.ts b/apps/web/app/(ee)/api/stripe/webhook/charge-failed.tsindex 2251d03de8..56f95b67c9 100644--- a/apps/web/app/(ee)/api/stripe/webhook/charge-failed.ts+++ b/apps/web/app/(ee)/api/stripe/webhook/charge-failed.ts@@ -53,22 +53,16 @@ export async function chargeFailed(event: Stripe.Event) {},});- // Reduce the payoutsUsage by the invoice amount since the charge failed- await prisma.project.update({+ const workspace = await prisma.project.update({where: {id: invoice.workspaceId,},+ // Reduce the payoutsUsage by the invoice amount since the charge faileddata: {payoutsUsage: {decrement: invoice.amount,},},- });-- const workspace = await prisma.project.findUniqueOrThrow({- where: {- id: invoice.workspaceId,- },include: {users: {select: {