setValue('ride_model_id', value)}
placeholder="Select model"
searchPlaceholder="Search models..."
@@ -595,7 +595,7 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }:
{/* Dates */}
{
setValue('opening_date', date ? toDateOnly(date) : undefined);
@@ -608,7 +608,7 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }:
/>
{
setValue('closing_date', date ? toDateOnly(date) : undefined);
@@ -1390,7 +1390,7 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }:
Create New Designer
{
setTempNewDesigner(data);
setIsDesignerModalOpen(false);
@@ -1413,7 +1413,7 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }:
{
setTempNewManufacturer(data);
setSelectedManufacturerName(data.name);
@@ -1442,9 +1442,9 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }:
{
setTempNewRideModel(data);
setIsModelModalOpen(false);
diff --git a/src/components/admin/SystemActivityLog.tsx b/src/components/admin/SystemActivityLog.tsx
index ff191dfe..df4f490d 100644
--- a/src/components/admin/SystemActivityLog.tsx
+++ b/src/components/admin/SystemActivityLog.tsx
@@ -730,7 +730,7 @@ export const SystemActivityLog = forwardRefUnknown activity type;
}
};
diff --git a/src/components/auth/AuthModal.tsx b/src/components/auth/AuthModal.tsx
index 3f416c66..5601fb05 100644
--- a/src/components/auth/AuthModal.tsx
+++ b/src/components/auth/AuthModal.tsx
@@ -126,7 +126,7 @@ export function AuthModal({ open, onOpenChange, defaultTab = 'signin' }: AuthMod
const { handlePostAuthFlow } = await import('@/lib/authService');
const postAuthResult = await handlePostAuthFlow(data.session, 'password');
- if (postAuthResult.success && postAuthResult.data.shouldRedirect) {
+ if (postAuthResult.success && postAuthResult.data?.shouldRedirect) {
// Get the TOTP factor ID
const { data: factors } = await supabase.auth.mfa.listFactors();
const totpFactor = factors?.totp?.find(f => f.status === 'verified');
diff --git a/src/types/database.ts b/src/types/database.ts
index a0a49ef8..332505a9 100644
--- a/src/types/database.ts
+++ b/src/types/database.ts
@@ -35,13 +35,13 @@ export interface Park {
id: string;
name: string;
slug: string;
- description?: string;
+ description?: string | null;
status: string; // Allow any string from database
park_type: string; // Allow any string from database
- opening_date?: string;
- opening_date_precision?: string;
- closing_date?: string;
- closing_date_precision?: string;
+ opening_date?: string | null;
+ opening_date_precision?: string | null;
+ closing_date?: string | null;
+ closing_date_precision?: string | null;
website_url?: string;
phone?: string;
email?: string;
@@ -132,7 +132,7 @@ export interface Ride {
id: string;
name: string;
slug: string;
- description?: string;
+ description?: string | null;
park?: Park | { name: string; slug: string; location?: Location }; // Allow partial park data
ride_model?: RideModel;
manufacturer?: Company;
@@ -140,10 +140,10 @@ export interface Ride {
category: string; // Allow any string from database
ride_sub_type?: string; // Sub-category like "Flying Coaster", "Inverted Coaster", etc.
status: string; // Allow any string from database
- opening_date?: string;
- opening_date_precision?: string;
- closing_date?: string;
- closing_date_precision?: string;
+ opening_date?: string | null;
+ opening_date_precision?: string | null;
+ closing_date?: string | null;
+ closing_date_precision?: string | null;
height_requirement?: number;
age_requirement?: number;
capacity_per_hour?: number;