mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 20:11:14 -05:00
feat: Implement final type safety fixes
This commit is contained in:
@@ -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"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user