The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Block program applications from partners banned from the network
Rafic4c657bcf127
diff --git a/apps/web/lib/actions/partners/create-program-application.ts b/apps/web/lib/actions/partners/create-program-application.tsindex 87a3e8ad89..3abc79cf51 100644--- a/apps/web/lib/actions/partners/create-program-application.ts+++ b/apps/web/lib/actions/partners/create-program-application.ts@@ -192,6 +192,12 @@ export const createProgramApplicationAction = actionClient}if (existingPartner) {+ if (existingPartner.networkStatus === "banned") {+ throw new Error(+ "Your account is banned from the Dub Partner Network, so you can't apply to programs. Please contact [email protected] if you think this is a mistake.",+ );+ }+// for in-app applications from existing partners, we need to check// if the partner has an incomplete profile, if so we prompt them to complete itif (inAppApplication) {diff --git a/apps/web/lib/partners/complete-program-applications.ts b/apps/web/lib/partners/complete-program-applications.tsindex 0cffb2f985..19fa2394ad 100644--- a/apps/web/lib/partners/complete-program-applications.ts+++ b/apps/web/lib/partners/complete-program-applications.ts@@ -55,7 +55,11 @@ export async function completeProgramApplications(userEmail: string) {},});- if (!user.partners.length) {+ // Partners banned from the network can't join programs through applications+ if (+ !user.partners.length ||+ user.partners[0].partner.networkStatus === "banned"+ ) {return;}