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.

special case for custom + click commissions for cancel action

Steven Teycb82c7b16852
diff --git a/apps/web/lib/actions/partners/mark-commission-fraud-or-canceled.ts b/apps/web/lib/actions/partners/mark-commission-fraud-or-canceled.ts
index c99b17b277..eacc1872ee 100644
--- a/apps/web/lib/actions/partners/mark-commission-fraud-or-canceled.ts
+++ b/apps/web/lib/actions/partners/mark-commission-fraud-or-canceled.ts
@@ -41,11 +41,13 @@ export const markCommissionFraudOrCanceledAction = authActionClient
const { partnerId, customerId } = commission;
- // for custom commissions, only update this commission
+ // for custom and click commissions, only update this commission
// for all other commission types, update all historical commissions for the customer and partner combination
const commissions = await prisma.commission.findMany({
where: {
- ...(commission.type === "custom" ? { id: commissionId } : {}),
+ ...(commission.type === "custom" || commission.type === "click"
+ ? { id: commissionId }
+ : {}),
partnerId,
customerId,
status: {
diff --git a/apps/web/ui/partners/mark-commission-fraud-or-canceled-modal.tsx b/apps/web/ui/partners/mark-commission-fraud-or-canceled-modal.tsx
index 70fc8d1e4b..beb2cdfd73 100644
--- a/apps/web/ui/partners/mark-commission-fraud-or-canceled-modal.tsx
+++ b/apps/web/ui/partners/mark-commission-fraud-or-canceled-modal.tsx
@@ -112,7 +112,7 @@ function ModalInner({
<div className="rounded-lg border border-red-200 bg-red-50 p-4">
<div className="text-sm text-red-900">
<span className="font-bold">Warning:</span> This will mark{" "}
- {commission.type === "custom"
+ {commission.type === "custom" || commission.type === "click"
? "this commission"
: "all future and past commissions for this customer and partner combination"}{" "}
as {status}. This action cannot be undone – please proceed with