The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Sync the index when Stripe reports a country change
Rafi37562c9a3429
diff --git a/apps/web/app/(ee)/api/stripe/connect/webhook/account-updated.ts b/apps/web/app/(ee)/api/stripe/connect/webhook/account-updated.tsindex 2d86f8ea14..52a7f0e313 100644--- a/apps/web/app/(ee)/api/stripe/connect/webhook/account-updated.ts+++ b/apps/web/app/(ee)/api/stripe/connect/webhook/account-updated.ts@@ -1,4 +1,5 @@import { detectDuplicatePayoutMethodFraud } from "@/lib/api/fraud/detect-duplicate-payout-method-fraud";+import { queuePartnerSearchSync } from "@/lib/api/partners/queue-partner-search-sync";import { qstash } from "@/lib/cron";import { getPartnerBankAccount } from "@/lib/partners/get-partner-bank-account";import { recomputePartnerPayoutState } from "@/lib/payouts/recompute-partner-payout-state";@@ -107,6 +108,11 @@ export async function accountUpdated(event: Stripe.AccountUpdatedEvent) {},});+ // Country is a filterable field on the document.+ if (countryChanged) {+ await queuePartnerSearchSync({ partnerIds: [partner.id] });+ }+if (!hasPayoutStateChanged) {return `No change in payout state for partner ${partner.email} (${partner.stripeConnectId}), skipping...`;}