fix: link input
parent
cfe2b7f624
commit
1792d8c172
|
@ -341,7 +341,7 @@ const EventTypePage = (props: EventTypeSetupProps) => {
|
||||||
const sampleUrl = eventLocationType.organizerInputPlaceholder;
|
const sampleUrl = eventLocationType.organizerInputPlaceholder;
|
||||||
ctx.addIssue({
|
ctx.addIssue({
|
||||||
code: z.ZodIssueCode.custom,
|
code: z.ZodIssueCode.custom,
|
||||||
path: [eventLocationType.defaultValueVariable],
|
path: [eventLocationType?.defaultValueVariable ?? "link"],
|
||||||
message: `Invalid URL for ${eventLocationType.label}. ${
|
message: `Invalid URL for ${eventLocationType.label}. ${
|
||||||
sampleUrl ? `Sample URL: ${sampleUrl}` : ""
|
sampleUrl ? `Sample URL: ${sampleUrl}` : ""
|
||||||
}`,
|
}`,
|
||||||
|
@ -350,11 +350,12 @@ const EventTypePage = (props: EventTypeSetupProps) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const valid = z.string().url().optional().safeParse(val).success;
|
const valid = z.string().url().optional().safeParse(link).success;
|
||||||
|
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
ctx.addIssue({
|
ctx.addIssue({
|
||||||
code: z.ZodIssueCode.custom,
|
code: z.ZodIssueCode.custom,
|
||||||
path: [eventLocationType.defaultValueVariable],
|
path: [eventLocationType?.defaultValueVariable ?? "link"],
|
||||||
message: `Invalid URL`,
|
message: `Invalid URL`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue