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.

quick fix

Steven Teye3b71a6a891b
diff --git a/apps/web/lib/actions/partners/confirm-payouts.ts b/apps/web/lib/actions/partners/confirm-payouts.ts
index 5759e2330e..7bd013e108 100644
--- a/apps/web/lib/actions/partners/confirm-payouts.ts
+++ b/apps/web/lib/actions/partners/confirm-payouts.ts
@@ -47,7 +47,9 @@ export const confirmPayoutsAction = authActionClient
throw new Error("Workspace does not have a valid Stripe ID.");
}
- if (workspace.payoutsUsage > workspace.payoutsLimit) {
+ // if workspace's payouts usage + the current invoice amount
+ // is greater than the workspace's payouts limit, throw an error
+ if (workspace.payoutsUsage + amount > workspace.payoutsLimit) {
throw new Error(
exceededLimitError({
plan: workspace.plan,