mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 20:51:12 -05:00
feat: Add submitter fields to entity forms
This commit is contained in:
@@ -53,6 +53,14 @@ export const parkValidationSchema = z.object({
|
||||
card_image_id: z.string().optional(),
|
||||
card_image_url: z.string().optional(),
|
||||
images: imageAssignmentSchema,
|
||||
source_url: z.string().trim().optional().or(z.literal('')).refine((val) => {
|
||||
if (!val || val === '') return true;
|
||||
return z.string().url().safeParse(val).success;
|
||||
}, 'Invalid URL format. Must be a valid URL starting with http:// or https://'),
|
||||
submission_notes: z.string().trim()
|
||||
.max(1000, 'Submission notes must be less than 1000 characters')
|
||||
.optional()
|
||||
.or(z.literal('')),
|
||||
}).refine((data) => {
|
||||
if (data.closing_date && data.opening_date) {
|
||||
return new Date(data.closing_date) >= new Date(data.opening_date);
|
||||
@@ -131,6 +139,14 @@ export const rideValidationSchema = z.object({
|
||||
card_image_id: z.string().optional(),
|
||||
card_image_url: z.string().optional(),
|
||||
images: imageAssignmentSchema,
|
||||
source_url: z.string().trim().optional().or(z.literal('')).refine((val) => {
|
||||
if (!val || val === '') return true;
|
||||
return z.string().url().safeParse(val).success;
|
||||
}, 'Invalid URL format. Must be a valid URL starting with http:// or https://'),
|
||||
submission_notes: z.string().trim()
|
||||
.max(1000, 'Submission notes must be less than 1000 characters')
|
||||
.optional()
|
||||
.or(z.literal('')),
|
||||
});
|
||||
|
||||
// ============================================
|
||||
@@ -159,6 +175,14 @@ export const companyValidationSchema = z.object({
|
||||
card_image_id: z.string().optional(),
|
||||
card_image_url: z.string().optional(),
|
||||
images: imageAssignmentSchema,
|
||||
source_url: z.string().trim().optional().or(z.literal('')).refine((val) => {
|
||||
if (!val || val === '') return true;
|
||||
return z.string().url().safeParse(val).success;
|
||||
}, 'Invalid URL format. Must be a valid URL starting with http:// or https://'),
|
||||
submission_notes: z.string().trim()
|
||||
.max(1000, 'Submission notes must be less than 1000 characters')
|
||||
.optional()
|
||||
.or(z.literal('')),
|
||||
});
|
||||
|
||||
// ============================================
|
||||
@@ -172,6 +196,14 @@ export const rideModelValidationSchema = z.object({
|
||||
ride_type: z.string().trim().min(1, 'Ride type is required').max(100, 'Ride type must be less than 100 characters'),
|
||||
description: z.string().trim().max(2000, 'Description must be less than 2000 characters').optional().or(z.literal('')),
|
||||
manufacturer_id: z.string().uuid('Invalid manufacturer ID').optional(),
|
||||
source_url: z.string().trim().optional().or(z.literal('')).refine((val) => {
|
||||
if (!val || val === '') return true;
|
||||
return z.string().url().safeParse(val).success;
|
||||
}, 'Invalid URL format. Must be a valid URL starting with http:// or https://'),
|
||||
submission_notes: z.string().trim()
|
||||
.max(1000, 'Submission notes must be less than 1000 characters')
|
||||
.optional()
|
||||
.or(z.literal('')),
|
||||
});
|
||||
|
||||
// ============================================
|
||||
|
||||
Reference in New Issue
Block a user