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.

small openapi changes

Steven Tey225a81224625
diff --git a/apps/web/lib/zod/schemas/commissions.ts b/apps/web/lib/zod/schemas/commissions.ts
index 8b515f4918..261da9727d 100644
--- a/apps/web/lib/zod/schemas/commissions.ts
+++ b/apps/web/lib/zod/schemas/commissions.ts
@@ -475,7 +475,10 @@ export const createManualCommissionBodySchema = z
.max(190)
.nullish()
.describe(
- "The description of the commission. Required for clawbacks (negative `amount`). May be a known clawback reason (`order_canceled`, `fraud`, `terms_violation`, `tracking_error`, `payment_failed`, `ineligible_partner`, `duplicate_commission`, `other`) or any other string.",
+ [
+ "The description of the commission. Required for clawbacks (negative `amount`).",
+ "May be a known clawback reason (`order_canceled`, `fraud`, `terms_violation`, `tracking_error`, `payment_failed`, `ineligible_partner`, `duplicate_commission`) or an arbitrary string (max 190 characters).",
+ ].join("\n"),
),
}),
@@ -575,7 +578,7 @@ export const createManualCommissionBodySchema = z
if (data.type === "custom") {
if (data.amount < 0 && !data.description?.trim()) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message:
"`description` is required when creating a clawback (negative amount).",
path: ["description"],
@@ -591,7 +594,7 @@ export const createManualCommissionBodySchema = z
if (data.saleAmount == null) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message:
"`saleAmount` is required when `importStripeInvoices` is false.",
path: ["saleAmount"],
@@ -601,7 +604,7 @@ export const createManualCommissionBodySchema = z
if (data.saleAmount === 0) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: "Sale amount cannot be 0.",
path: ["saleAmount"],
});
diff --git a/apps/web/lib/zod/schemas/opens.ts b/apps/web/lib/zod/schemas/opens.ts
index 96f2637bb6..e8f539b720 100644
--- a/apps/web/lib/zod/schemas/opens.ts
+++ b/apps/web/lib/zod/schemas/opens.ts
@@ -18,7 +18,7 @@ export const trackOpenRequestSchema = z
.superRefine((data, ctx) => {
if (!data.deepLink && !data.dubDomain) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message:
"You need to provide either `deepLink` or `dubDomain` for deferred deep linking.",
});
diff --git a/apps/web/lib/zod/schemas/submitted-lead-form.ts b/apps/web/lib/zod/schemas/submitted-lead-form.ts
index fef682bc80..87935eff93 100644
--- a/apps/web/lib/zod/schemas/submitted-lead-form.ts
+++ b/apps/web/lib/zod/schemas/submitted-lead-form.ts
@@ -100,7 +100,7 @@ export const formFieldsSchema = z
ctx.addIssue({
path: ["fields"],
message: `Duplicate field key: ${field.key}`,
- code: z.ZodIssueCode.custom,
+ code: "custom",
});
}
@@ -108,7 +108,7 @@ export const formFieldsSchema = z
ctx.addIssue({
path: ["fields"],
message: `Duplicate field position: ${field.position}`,
- code: z.ZodIssueCode.custom,
+ code: "custom",
});
}
diff --git a/apps/web/lib/zod/schemas/tags.ts b/apps/web/lib/zod/schemas/tags.ts
index 2f4116a17f..cc9fc26ece 100644
--- a/apps/web/lib/zod/schemas/tags.ts
+++ b/apps/web/lib/zod/schemas/tags.ts
@@ -69,7 +69,7 @@ export const createTagBodySchema = z
.superRefine((data, ctx) => {
if (!data.name && !data.tag) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
path: ["name"],
message: "Name is required.",
});
diff --git a/apps/web/lib/zod/schemas/token.ts b/apps/web/lib/zod/schemas/token.ts
index b9e2d28025..7c6931229a 100644
--- a/apps/web/lib/zod/schemas/token.ts
+++ b/apps/web/lib/zod/schemas/token.ts
@@ -51,7 +51,7 @@ export const createReferralsEmbedTokenSchema = z
.superRefine((data, ctx) => {
if (!data.partnerId && !data.tenantId && !data.partner) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: "You must provide either partnerId, tenantId, or partner.",
});
}