Refactor: Execute remaining phases

This commit is contained in:
gpt-engineer-app[bot]
2025-10-20 13:30:02 +00:00
parent 6f1baef8c0
commit 368b97da04
10 changed files with 167 additions and 105 deletions

View File

@@ -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);