mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 17:51:14 -05:00
Fix: Remove SECURITY DEFINER views
This commit is contained in:
@@ -46,6 +46,28 @@ const designerSchema = z.object({
|
||||
|
||||
type DesignerFormData = z.infer<typeof designerSchema>;
|
||||
|
||||
// Input type for the form (before transformation)
|
||||
type DesignerFormInput = {
|
||||
name: string;
|
||||
slug: string;
|
||||
description?: string;
|
||||
person_type: 'company' | 'individual' | 'firm' | 'organization';
|
||||
website_url?: string;
|
||||
founded_year?: string;
|
||||
headquarters_location?: string;
|
||||
images?: {
|
||||
uploaded: Array<{
|
||||
url: string;
|
||||
cloudflare_id?: string;
|
||||
file?: any;
|
||||
isLocal?: boolean;
|
||||
caption?: string;
|
||||
}>;
|
||||
banner_assignment?: number | null;
|
||||
card_assignment?: number | null;
|
||||
};
|
||||
};
|
||||
|
||||
interface DesignerFormProps {
|
||||
onSubmit: (data: DesignerFormData) => void;
|
||||
onCancel: () => void;
|
||||
@@ -66,7 +88,7 @@ export function DesignerForm({ onSubmit, onCancel, initialData }: DesignerFormPr
|
||||
setValue,
|
||||
watch,
|
||||
formState: { errors }
|
||||
} = useForm<DesignerFormData>({
|
||||
} = useForm<DesignerFormInput>({
|
||||
resolver: zodResolver(designerSchema),
|
||||
defaultValues: {
|
||||
name: initialData?.name || '',
|
||||
@@ -77,7 +99,7 @@ export function DesignerForm({ onSubmit, onCancel, initialData }: DesignerFormPr
|
||||
founded_year: initialData?.founded_year ? String(initialData.founded_year) : '',
|
||||
headquarters_location: initialData?.headquarters_location || '',
|
||||
images: initialData?.images || { uploaded: [] }
|
||||
} as Partial<DesignerFormData>
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -90,7 +112,7 @@ export function DesignerForm({ onSubmit, onCancel, initialData }: DesignerFormPr
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form onSubmit={handleSubmit(onSubmit)} className="space-y-6">
|
||||
<form onSubmit={handleSubmit((data) => onSubmit(data as unknown as DesignerFormData))} className="space-y-6">
|
||||
{/* Basic Information */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div className="space-y-2">
|
||||
|
||||
Reference in New Issue
Block a user