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.

Reuse website from program application for partner

Steven Tey4ace2d918202
diff --git a/apps/web/lib/partners/complete-program-applications.ts b/apps/web/lib/partners/complete-program-applications.ts
index ca6f832e1e..cf93c17f23 100644
--- a/apps/web/lib/partners/complete-program-applications.ts
+++ b/apps/web/lib/partners/complete-program-applications.ts
@@ -103,11 +103,21 @@ export async function completeProgramApplications(userId: string) {
const program = programApplication.program;
const application = programApplication;
- await notifyPartnerApplication({
- partner,
- program,
- application,
- });
+ await Promise.allSettled([
+ notifyPartnerApplication({
+ partner,
+ program,
+ application,
+ }),
+ // if the application has a website but the partner doesn't have a website (maybe they forgot to add during onboarding)
+ // update the partner to use the website they applied with
+ application.website &&
+ !partner.website &&
+ prisma.partner.update({
+ where: { id: partner.id },
+ data: { website: application.website },
+ }),
+ ]);
}
cookieStore.delete("programApplicationIds");