mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 10:11:13 -05:00
Fix: Resolve type incompatibility in company person_type
This commit is contained in:
@@ -341,9 +341,9 @@ export default function DesignerDetail() {
|
||||
name: designer.name,
|
||||
slug: designer.slug,
|
||||
description: designer.description,
|
||||
company_type: 'designer',
|
||||
person_type: designer.person_type,
|
||||
website_url: designer.website_url,
|
||||
company_type: 'designer',
|
||||
person_type: (designer.person_type || 'company') as 'company' | 'individual' | 'firm' | 'organization',
|
||||
website_url: designer.website_url,
|
||||
founded_year: designer.founded_year,
|
||||
headquarters_location: designer.headquarters_location,
|
||||
banner_image_url: designer.banner_image_url,
|
||||
|
||||
@@ -375,9 +375,9 @@ export default function ManufacturerDetail() {
|
||||
name: manufacturer.name,
|
||||
slug: manufacturer.slug,
|
||||
description: manufacturer.description,
|
||||
company_type: 'manufacturer',
|
||||
person_type: manufacturer.person_type,
|
||||
website_url: manufacturer.website_url,
|
||||
company_type: 'manufacturer',
|
||||
person_type: (manufacturer.person_type || 'company') as 'company' | 'individual' | 'firm' | 'organization',
|
||||
website_url: manufacturer.website_url,
|
||||
founded_year: manufacturer.founded_year,
|
||||
headquarters_location: manufacturer.headquarters_location,
|
||||
banner_image_url: manufacturer.banner_image_url,
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Badge } from '@/components/ui/badge';
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||
import { Dialog, DialogContent } from '@/components/ui/dialog';
|
||||
import { ArrowLeft, Filter, SlidersHorizontal, FerrisWheel, Plus } from 'lucide-react';
|
||||
import { RideModel, Company } from '@/types/database';
|
||||
import { RideModel, Company, Park } from '@/types/database';
|
||||
import { RideModelSubmissionData } from '@/types/submission-data';
|
||||
import { supabase } from '@/integrations/supabase/client';
|
||||
import { RideModelCard } from '@/components/rides/RideModelCard';
|
||||
@@ -16,6 +16,10 @@ import { useAuth } from '@/hooks/useAuth';
|
||||
import { toast } from '@/hooks/use-toast';
|
||||
import { useAuthModal } from '@/hooks/useAuthModal';
|
||||
|
||||
interface RideModelWithCount extends RideModel {
|
||||
ride_count: number;
|
||||
}
|
||||
|
||||
export default function ManufacturerModels() {
|
||||
const { manufacturerSlug } = useParams<{ manufacturerSlug: string }>();
|
||||
const navigate = useNavigate();
|
||||
@@ -71,7 +75,7 @@ export default function ManufacturerModels() {
|
||||
const modelsWithCounts: RideModelWithCount[] = (modelsData || []).map(model => ({
|
||||
...model,
|
||||
ride_count: Array.isArray(model.rides) ? model.rides[0]?.count || 0 : 0
|
||||
}));
|
||||
})) as RideModelWithCount[];
|
||||
|
||||
setModels(modelsWithCounts);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import { Dialog, DialogContent } from '@/components/ui/dialog';
|
||||
import { ArrowLeft, MapPin, Star, Globe, Calendar, Edit, FerrisWheel, Gauge } from 'lucide-react';
|
||||
import { Company } from '@/types/database';
|
||||
import { Company, Park } from '@/types/database';
|
||||
import { supabase } from '@/integrations/supabase/client';
|
||||
import { OperatorForm } from '@/components/admin/OperatorForm';
|
||||
import { OperatorPhotoGallery } from '@/components/companies/OperatorPhotoGallery';
|
||||
@@ -427,9 +427,9 @@ export default function OperatorDetail() {
|
||||
name: operator.name,
|
||||
slug: operator.slug,
|
||||
description: operator.description,
|
||||
company_type: 'operator',
|
||||
person_type: operator.person_type,
|
||||
website_url: operator.website_url,
|
||||
company_type: 'operator',
|
||||
person_type: (operator.person_type || 'company') as 'company' | 'individual' | 'firm' | 'organization',
|
||||
website_url: operator.website_url,
|
||||
founded_year: operator.founded_year,
|
||||
headquarters_location: operator.headquarters_location,
|
||||
banner_image_url: operator.banner_image_url,
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import { Dialog, DialogContent } from '@/components/ui/dialog';
|
||||
import { ArrowLeft, MapPin, Star, Globe, Calendar, Edit, Building2, Gauge } from 'lucide-react';
|
||||
import { Company } from '@/types/database';
|
||||
import { Company, Park } from '@/types/database';
|
||||
import { supabase } from '@/integrations/supabase/client';
|
||||
import { PropertyOwnerForm } from '@/components/admin/PropertyOwnerForm';
|
||||
import { PropertyOwnerPhotoGallery } from '@/components/companies/PropertyOwnerPhotoGallery';
|
||||
@@ -427,9 +427,9 @@ export default function PropertyOwnerDetail() {
|
||||
name: owner.name,
|
||||
slug: owner.slug,
|
||||
description: owner.description,
|
||||
company_type: 'property_owner',
|
||||
person_type: owner.person_type,
|
||||
website_url: owner.website_url,
|
||||
company_type: 'property_owner',
|
||||
person_type: (owner.person_type || 'company') as 'company' | 'individual' | 'firm' | 'organization',
|
||||
website_url: owner.website_url,
|
||||
founded_year: owner.founded_year,
|
||||
headquarters_location: owner.headquarters_location,
|
||||
banner_image_url: owner.banner_image_url,
|
||||
|
||||
@@ -16,7 +16,7 @@ export interface Company {
|
||||
slug: string;
|
||||
description?: string;
|
||||
company_type: string; // Allow any string from database
|
||||
person_type: 'company' | 'individual' | 'firm' | 'organization';
|
||||
person_type?: string; // Database returns string, validated at form level
|
||||
website_url?: string;
|
||||
founded_year?: number; // Legacy field
|
||||
founded_date?: string;
|
||||
|
||||
Reference in New Issue
Block a user