feat: Implement final type safety fixes

This commit is contained in:
gpt-engineer-app[bot]
2025-10-17 15:06:35 +00:00
parent 5466c60b84
commit 77deb62742
13 changed files with 85 additions and 33 deletions

View File

@@ -17,6 +17,7 @@ import { ParkCard } from '@/components/parks/ParkCard';
import { useAuth } from '@/hooks/useAuth';
import { useUserRole } from '@/hooks/useUserRole';
import { toast } from '@/hooks/use-toast';
import { getErrorMessage } from '@/lib/errorHandler';
import { submitCompanyUpdate } from '@/lib/companyHelpers';
import { VersionIndicator } from '@/components/versioning/VersionIndicator';
import { EntityHistoryTabs } from '@/components/history/EntityHistoryTabs';
@@ -154,10 +155,11 @@ export default function PropertyOwnerDetail() {
});
setIsEditModalOpen(false);
} catch (error: any) {
} catch (error) {
const errorMsg = getErrorMessage(error);
toast({
title: "Error",
description: error.message || "Failed to submit edit.",
description: errorMsg || "Failed to submit edit.",
variant: "destructive"
});
}

View File

@@ -45,6 +45,7 @@ import { RideForm } from '@/components/admin/RideForm';
import { useAuth } from '@/hooks/useAuth';
import { useUserRole } from '@/hooks/useUserRole';
import { toast } from '@/hooks/use-toast';
import { getErrorMessage } from '@/lib/errorHandler';
import { VersionIndicator } from '@/components/versioning/VersionIndicator';
import { EntityHistoryTabs } from '@/components/history/EntityHistoryTabs';
import { useAuthModal } from '@/hooks/useAuthModal';
@@ -183,10 +184,11 @@ export default function RideDetail() {
});
setIsEditModalOpen(false);
} catch (error: any) {
} catch (error) {
const errorMsg = getErrorMessage(error);
toast({
title: "Error",
description: error.message || "Failed to submit edit.",
description: errorMsg || "Failed to submit edit.",
variant: "destructive"
});
}

View File

@@ -14,6 +14,7 @@ import { getCloudflareImageUrl } from '@/lib/cloudflareImageUtils';
import { useAuthModal } from '@/hooks/useAuthModal';
import { useAuth } from '@/hooks/useAuth';
import { toast } from '@/hooks/use-toast';
import { getErrorMessage } from '@/lib/errorHandler';
import { RideModelForm } from '@/components/admin/RideModelForm';
import { ManufacturerPhotoGallery } from '@/components/companies/ManufacturerPhotoGallery';
import { VersionIndicator } from '@/components/versioning/VersionIndicator';
@@ -120,10 +121,11 @@ export default function RideModelDetail() {
setIsEditModalOpen(false);
fetchData();
} catch (error: any) {
} catch (error) {
const errorMsg = getErrorMessage(error);
toast({
title: "Error",
description: error.message || "Failed to update ride model.",
description: errorMsg || "Failed to update ride model.",
variant: "destructive"
});
}

View File

@@ -14,6 +14,7 @@ import { RideForm } from '@/components/admin/RideForm';
import { useAuth } from '@/hooks/useAuth';
import { useAuthModal } from '@/hooks/useAuthModal';
import { toast } from '@/hooks/use-toast';
import { getErrorMessage } from '@/lib/errorHandler';
import type { Ride, Company, RideModel } from "@/types/database";
export default function RideModelRides() {
@@ -142,10 +143,11 @@ export default function RideModelRides() {
setIsCreateModalOpen(false);
fetchData();
} catch (error: any) {
} catch (error) {
const errorMsg = getErrorMessage(error);
toast({
title: "Error",
description: error.message || "Failed to submit ride.",
description: errorMsg || "Failed to submit ride.",
variant: "destructive"
});
}

View File

@@ -14,6 +14,7 @@ import { supabase } from '@/integrations/supabase/client';
import { useAuth } from '@/hooks/useAuth';
import { useUserRole } from '@/hooks/useUserRole';
import { toast } from '@/hooks/use-toast';
import { getErrorMessage } from '@/lib/errorHandler';
import { useAuthModal } from '@/hooks/useAuthModal';
export default function Rides() {
@@ -89,10 +90,11 @@ export default function Rides() {
});
setIsCreateModalOpen(false);
} catch (error: any) {
} catch (error) {
const errorMsg = getErrorMessage(error);
toast({
title: "Submission Failed",
description: error.message || "Failed to submit ride.",
description: errorMsg || "Failed to submit ride.",
variant: "destructive"
});
}