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.

Update route.ts

Kiran K0f463c53e1d8
diff --git a/apps/web/app/(ee)/api/partner-profile/invites/route.ts b/apps/web/app/(ee)/api/partner-profile/invites/route.ts
index 648833e62f..5a56289178 100644
--- a/apps/web/app/(ee)/api/partner-profile/invites/route.ts
+++ b/apps/web/app/(ee)/api/partner-profile/invites/route.ts
@@ -129,14 +129,22 @@ export const POST = withPartnerProfile(async ({ partner, req, session }) => {
export const DELETE = withPartnerProfile(async ({ searchParams, partner }) => {
const { email } = removeInviteSchema.parse(searchParams);
- const response = await prisma.partnerInvite.delete({
- where: {
- email_partnerId: {
- email,
- partnerId: partner.id,
+ await prisma.$transaction([
+ prisma.partnerInvite.delete({
+ where: {
+ email_partnerId: {
+ email,
+ partnerId: partner.id,
+ },
+ },
+ }),
+
+ prisma.verificationToken.deleteMany({
+ where: {
+ identifier: email,
},
- },
- });
+ }),
+ ]);
- return NextResponse.json(response);
+ return NextResponse.json({ email });
});