Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix transaction closed error

Steven Tey3de7d39781e8
diff --git a/apps/web/app/api/stripe/webhook/charge-succeeded.ts b/apps/web/app/api/stripe/webhook/charge-succeeded.ts
index 02adf724b0..4ccf26f1bf 100644
--- a/apps/web/app/api/stripe/webhook/charge-succeeded.ts
+++ b/apps/web/app/api/stripe/webhook/charge-succeeded.ts
@@ -56,26 +56,23 @@ export async function chargeSucceeded(event: Stripe.Event) {
console.log("Transfer created", transfer);
await Promise.all([
- prisma.$transaction(async (tx) => {
- await tx.payout.update({
- where: {
- id: payout.id,
- },
- data: {
- stripeTransferId: transfer.id,
- status: "completed",
- paidAt: new Date(),
- },
- });
-
- await tx.commission.updateMany({
- where: {
- payoutId: payout.id,
- },
- data: {
- status: "paid",
- },
- });
+ prisma.payout.update({
+ where: {
+ id: payout.id,
+ },
+ data: {
+ stripeTransferId: transfer.id,
+ status: "completed",
+ paidAt: new Date(),
+ },
+ }),
+ prisma.commission.updateMany({
+ where: {
+ payoutId: payout.id,
+ },
+ data: {
+ status: "paid",
+ },
}),
payout.partner.email &&
sendEmail({