Fix remaining console logs and types

This commit is contained in:
gpt-engineer-app[bot]
2025-11-03 20:04:11 +00:00
parent 6fbaf0c606
commit 2cd6b2c6c3
10 changed files with 127 additions and 42 deletions

View File

@@ -174,9 +174,9 @@ export function ManufacturerForm({ onSubmit, onCancel, initialData }: Manufactur
precision={(watch('founded_date_precision') as DatePrecision) || 'year'}
onChange={(date, precision) => {
if (date && typeof date === 'string') {
setValue('founded_date', toDateOnly(date) as any);
setValue('founded_date', toDateOnly(date), { shouldValidate: true });
} else {
setValue('founded_date', null as any);
setValue('founded_date', '', { shouldValidate: true });
}
setValue('founded_date_precision', precision);
}}

View File

@@ -64,7 +64,7 @@ const parkSchema = z.object({
uploaded: z.array(z.object({
url: z.string(),
cloudflare_id: z.string().optional(),
file: z.any().optional(),
file: z.instanceof(File).optional(),
isLocal: z.boolean().optional(),
caption: z.string().optional(),
})),

View File

@@ -31,7 +31,7 @@ const rideModelSchema = z.object({
uploaded: z.array(z.object({
url: z.string(),
cloudflare_id: z.string().optional(),
file: z.any().optional(),
file: z.instanceof(File).optional(),
isLocal: z.boolean().optional(),
caption: z.string().optional()
})),

View File

@@ -1,5 +1,5 @@
import { useState, useEffect } from 'react';
import { Star, TrendingUp, Award, Castle, FerrisWheel, Waves, Tent } from 'lucide-react';
import { Star, TrendingUp, Award, Castle, FerrisWheel, Waves, Tent, LucideIcon } from 'lucide-react';
import { Card, CardContent } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
@@ -50,7 +50,7 @@ export function FeaturedParks() {
}
};
const FeaturedParkCard = ({ park, icon: Icon, label }: { park: Park; icon: any; label: string }) => (
const FeaturedParkCard = ({ park, icon: Icon, label }: { park: Park; icon: LucideIcon; label: string }) => (
<Card className="group overflow-hidden border-border/50 bg-gradient-to-br from-card via-card to-card/80 hover:shadow-xl hover:shadow-primary/10 transition-all duration-300 cursor-pointer hover:scale-[1.02]">
<div className="relative">
{/* Gradient Background */}

View File

@@ -71,12 +71,19 @@ export function ListSearch({ listType, onSelect, onClose }: ListSearchProps) {
.limit(10);
if (rides) {
interface RideSearchResult {
id: string;
name: string;
park?: { name: string } | null;
category?: string | null;
}
searchResults.push(
...rides.map((ride: any) => ({
...rides.map((ride: RideSearchResult) => ({
id: ride.id,
name: ride.name,
type: "ride" as const,
subtitle: ride.park?.name || ride.category,
subtitle: ride.park?.name || ride.category || 'Unknown',
}))
);
}

View File

@@ -69,7 +69,7 @@ export function UserListManager() {
});
} else {
// Map Supabase data to UserTopList interface
const mappedLists: UserTopList[] = (data || []).map((list: any) => ({
const mappedLists: UserTopList[] = (data || []).map(list => ({
id: list.id,
user_id: list.user_id,
title: list.title,
@@ -78,7 +78,16 @@ export function UserListManager() {
is_public: list.is_public,
created_at: list.created_at,
updated_at: list.updated_at,
items: list.list_items || [],
items: (list.list_items || []).map(item => ({
id: item.id,
list_id: list.id, // Add the parent list ID
entity_type: item.entity_type as 'park' | 'ride' | 'company',
entity_id: item.entity_id,
position: item.position,
notes: item.notes,
created_at: item.created_at || new Date().toISOString(),
updated_at: item.updated_at || new Date().toISOString(),
})),
}));
setLists(mappedLists);
}