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.

Update partners.ts

Kiran K84031359d13a
diff --git a/apps/web/lib/zod/schemas/partners.ts b/apps/web/lib/zod/schemas/partners.ts
index a9f3515598..42f6e22bad 100644
--- a/apps/web/lib/zod/schemas/partners.ts
+++ b/apps/web/lib/zod/schemas/partners.ts
@@ -10,7 +10,11 @@ import { z } from "zod";
import { analyticsQuerySchema } from "./analytics";
import { analyticsResponse } from "./analytics-response";
import { createLinkBodySchema } from "./links";
-import { booleanQuerySchema, getPaginationQuerySchema } from "./misc";
+import {
+ booleanQuerySchema,
+ getPaginationQuerySchema,
+ uploadedImageSchema,
+} from "./misc";
import { ProgramEnrollmentSchema } from "./programs";
import { parseUrlSchema } from "./utils";
@@ -407,10 +411,14 @@ export const onboardPartnerSchema = createPartnerSchema
})
.merge(
z.object({
- name: z.string(),
- image: z.string(),
+ name: z.string().min(1, "Name is required"),
+ image: uploadedImageSchema
+ .transform((v) => v || "")
+ .refine((v) => v !== "", {
+ message: "Image is required",
+ }),
country: z.enum(COUNTRY_CODES),
- profileType: z.enum(["individual", "company"]).default("individual"),
+ profileType: z.nativeEnum(PartnerProfileType).default("individual"),
companyName: z.string().nullish(),
}),
)