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 project creation bug again

Steven Tey30be25601d8f
diff --git a/apps/web/app/api/projects/route.ts b/apps/web/app/api/projects/route.ts
index 32df09eb52..abdc13cd15 100644
--- a/apps/web/app/api/projects/route.ts
+++ b/apps/web/app/api/projects/route.ts
@@ -118,12 +118,14 @@ export const POST = withSession(async ({ req, session }) => {
role: "owner",
},
},
- domains: {
- create: {
- slug: domain,
- primary: true,
+ ...(domain && {
+ domains: {
+ create: {
+ slug: domain,
+ primary: true,
+ },
},
- },
+ }),
billingCycleStart: new Date().getDate(),
},
}),