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 unban-partner.ts

Kiran K43bb4b79d79a
diff --git a/apps/web/lib/actions/partners/unban-partner.ts b/apps/web/lib/actions/partners/unban-partner.ts
index 50d15b0c21..4fbad7c984 100644
--- a/apps/web/lib/actions/partners/unban-partner.ts
+++ b/apps/web/lib/actions/partners/unban-partner.ts
@@ -10,7 +10,7 @@ import { getDefaultProgramIdOrThrow } from "@/lib/api/programs/get-default-progr
import { prisma } from "@/lib/prisma";
import { recordLink } from "@/lib/tinybird";
import { banPartnerSchema } from "@/lib/zod/schemas/partners";
-import { FraudEventStatus, FraudRuleType } from "@prisma/client";
+import { FraudRuleType } from "@prisma/client";
import { waitUntil } from "@vercel/functions";
import { authActionClient } from "../safe-action";
import { throwIfNoPermission } from "../throw-if-no-permission";
@@ -168,25 +168,6 @@ export const unbanPartnerAction = authActionClient
}),
]);
- // Find the cross-program ban groups (in other programs) whose only
- // events originated from this program — deleting their events below will
- // empty them out, so their held commissions must be released first.
- const affectedFraudGroups = await prisma.fraudEventGroup.findMany({
- where: {
- partnerId,
- type: FraudRuleType.partnerCrossProgramBan,
- status: FraudEventStatus.pending,
- fraudEvents: {
- every: {
- sourceProgramId: programId,
- },
- },
- },
- select: {
- id: true,
- },
- });
-
await prisma.$transaction([
// Since we're unbanning the partner, we need to
// clean up any pending cross-program ban alerts that originated from this program.