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.

add canManageFraudEvents condition to commissions status

Steven Tey5f0037e41c76
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/commissions/commission-table.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/commissions/commission-table.tsx
index 5f890ce3bc..e4a33a789f 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/commissions/commission-table.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/commissions/commission-table.tsx
@@ -1,5 +1,6 @@
"use client";
+import { getPlanCapabilities } from "@/lib/plan-capabilities";
import useCommissionsCount from "@/lib/swr/use-commissions-count";
import { useFraudGroupCount } from "@/lib/swr/use-fraud-groups-count";
import useGroups from "@/lib/swr/use-groups";
@@ -135,6 +136,8 @@ export function CommissionTable() {
},
});
+ const { canManageFraudEvents } = getPlanCapabilities(workspace?.plan ?? "");
+
const columns = useMemo(
() =>
[
@@ -277,6 +280,7 @@ export function CommissionTable() {
);
const status =
+ canManageFraudEvents &&
partnerHasPendingFraud &&
["pending", "processed"].includes(row.original.status)
? "hold"