The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
fix payout reminder
Steven Teya51287909b2f
diff --git a/apps/web/app/(ee)/api/cron/payouts/reminders/partners/route.ts b/apps/web/app/(ee)/api/cron/payouts/reminders/partners/route.tsindex d8b822402f..a2e9210b0a 100644--- a/apps/web/app/(ee)/api/cron/payouts/reminders/partners/route.ts+++ b/apps/web/app/(ee)/api/cron/payouts/reminders/partners/route.ts@@ -40,15 +40,26 @@ export const GET = withCron(async () => {},partner: {payoutsEnabledAt: null,- country: {- in: PAYOUT_SUPPORTED_COUNTRIES.map((c) => c.code),- },- OR: [- { connectPayoutsLastRemindedAt: null },+ AND: [{- connectPayoutsLastRemindedAt: {- lte: new Date(Date.now() - 3 * 24 * 60 * 60 * 1000), // Last notified was at least 3 days ago- },+ OR: [+ { country: null },+ {+ country: {+ in: PAYOUT_SUPPORTED_COUNTRIES.map((c) => c.code),+ },+ },+ ],+ },+ {+ OR: [+ { connectPayoutsLastRemindedAt: null },+ {+ connectPayoutsLastRemindedAt: {+ lte: new Date(Date.now() - 3 * 24 * 60 * 60 * 1000),+ },+ },+ ],},],},