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.

final changes

Steven Teya4783b883dd8
diff --git a/apps/web/lib/api/partners/create-and-enroll-partner.ts b/apps/web/lib/api/partners/create-and-enroll-partner.ts
index 982d08916e..f16cb51765 100644
--- a/apps/web/lib/api/partners/create-and-enroll-partner.ts
+++ b/apps/web/lib/api/partners/create-and-enroll-partner.ts
@@ -138,7 +138,7 @@ export const createAndEnrollPartner = async ({
create: {
...payload,
id: createId({ prefix: "pn_" }),
- name: partner.name,
+ name: partner.name || partner.email,
email: partner.email,
image: partner.image && !isStored(partner.image) ? null : partner.image,
country: partner.country,
diff --git a/apps/web/lib/zod/schemas/partners.ts b/apps/web/lib/zod/schemas/partners.ts
index 5d4a44f146..e592ac6614 100644
--- a/apps/web/lib/zod/schemas/partners.ts
+++ b/apps/web/lib/zod/schemas/partners.ts
@@ -325,7 +325,7 @@ export const createPartnerSchema = z.object({
.max(100)
.nullish()
.describe(
- "The partner's full legal name. If undefined, the partner's name will be generated from the email address (e.g. `[email protected]` -> `John`).",
+ "The partner's full name. If undefined, the partner's email will be used in lieu of their name (e.g. `[email protected]`)",
),
email: z
.string()
@@ -334,7 +334,7 @@ export const createPartnerSchema = z.object({
.max(190)
.email()
.describe(
- "The partner's email address in your system. Partners will be able to claim their profile by signing up at partners.dub.co with this email.",
+ "The partner's email address. Partners will be able to claim their profile by signing up at `partners.dub.co` with this email.",
),
username: z
.string()
@@ -349,6 +349,12 @@ export const createPartnerSchema = z.object({
.describe(
"The partner's avatar image. If not provided, a default avatar will be used.",
),
+ tenantId: z
+ .string()
+ .optional()
+ .describe(
+ "The partner's unique ID in your system. Useful for retrieving the partner's links and stats later on. If not provided, the partner will be created as a standalone partner.",
+ ),
country: z
.enum(COUNTRY_CODES)
.nullish()
@@ -362,12 +368,6 @@ export const createPartnerSchema = z.object({
.describe(
"A brief description of the partner and their background. Max 5,000 characters.",
),
- tenantId: z
- .string()
- .optional()
- .describe(
- "The partner's unique ID in your system. Useful for retrieving the partner's links and stats later on. If not provided, the partner will be created as a standalone partner.",
- ),
linkProps: createLinkBodySchema
.omit({
url: true,