mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 01:11:13 -05:00
Refactor: Execute remaining phases
This commit is contained in:
@@ -20,7 +20,7 @@ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } f
|
||||
import { Combobox } from '@/components/ui/combobox';
|
||||
import { SlugField } from '@/components/ui/slug-field';
|
||||
import { toast } from '@/hooks/use-toast';
|
||||
import { getErrorMessage } from '@/lib/errorHandler';
|
||||
import { handleError } from '@/lib/errorHandler';
|
||||
import { Plus, Zap, Save, X } from 'lucide-react';
|
||||
import { toDateOnly } from '@/lib/dateUtils';
|
||||
import { useUnitPreferences } from '@/hooks/useUnitPreferences';
|
||||
@@ -264,12 +264,14 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }:
|
||||
? "Ride, manufacturer, and model submitted for review"
|
||||
: "Ride submitted for review"
|
||||
});
|
||||
} catch (error) {
|
||||
const errorMsg = getErrorMessage(error);
|
||||
toast({
|
||||
title: "Error",
|
||||
description: errorMsg,
|
||||
variant: "destructive"
|
||||
} catch (error: unknown) {
|
||||
handleError(error, {
|
||||
action: isEditing ? 'Update Ride' : 'Create Ride',
|
||||
metadata: {
|
||||
rideName: data.name,
|
||||
hasNewManufacturer: !!tempNewManufacturer,
|
||||
hasNewModel: !!tempNewRideModel
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
|
||||
Reference in New Issue
Block a user