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.

fix calculation

Steven Tey44c5f14ab379
diff --git a/apps/web/app/(ee)/api/admin/payouts/stablecoin/route.ts b/apps/web/app/(ee)/api/admin/payouts/stablecoin/route.ts
index 2b31fc904f..b98eeed99a 100644
--- a/apps/web/app/(ee)/api/admin/payouts/stablecoin/route.ts
+++ b/apps/web/app/(ee)/api/admin/payouts/stablecoin/route.ts
@@ -37,19 +37,26 @@ export const GET = withAdmin(async ({ searchParams }) => {
where: {
...(status && { status }),
...(programId && { programId }),
- partner: {
- defaultPayoutMethod: "stablecoin",
- stripeRecipientId: {
- not: null,
+ OR: [
+ {
+ method: "stablecoin",
},
- cryptoWalletAddress: {
- not: null,
+ {
+ status: "pending",
+ partner: {
+ stripeRecipientId: {
+ not: null,
+ },
+ cryptoWalletAddress: {
+ not: null,
+ },
+ payoutsEnabledAt: {
+ not: null,
+ },
+ ...(country && { country }),
+ },
},
- payoutsEnabledAt: {
- not: null,
- },
- ...(country && { country }),
- },
+ ],
},
orderBy: {
amount: "desc",
@@ -66,17 +73,7 @@ export const GET = withAdmin(async ({ searchParams }) => {
.parse(
payouts.filter(
(payout) =>
- (
- payout as typeof payout & {
- program?: { minPayoutAmount: number };
- }
- ).program &&
- payout.amount >=
- (
- payout as typeof payout & {
- program: { minPayoutAmount: number };
- }
- ).program.minPayoutAmount,
+ payout.program && payout.amount >= payout.program.minPayoutAmount,
),
),
);