mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 01:51:12 -05:00
Refactor: Execute remaining phases
This commit is contained in:
@@ -15,7 +15,7 @@ import { DatePicker } from '@/components/ui/date-picker';
|
||||
import { FlexibleDateInput, type DatePrecision } from '@/components/ui/flexible-date-input';
|
||||
import { SlugField } from '@/components/ui/slug-field';
|
||||
import { toast } from '@/hooks/use-toast';
|
||||
import { getErrorMessage } from '@/lib/errorHandler';
|
||||
import { handleError } from '@/lib/errorHandler';
|
||||
import { MapPin, Save, X, Plus } from 'lucide-react';
|
||||
import { toDateOnly } from '@/lib/dateUtils';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
@@ -193,12 +193,16 @@ export function ParkForm({ onSubmit, onCancel, initialData, isEditing = false }:
|
||||
? "The park information has been updated successfully."
|
||||
: "The new park has been created successfully."
|
||||
});
|
||||
} catch (error) {
|
||||
const errorMsg = getErrorMessage(error);
|
||||
toast({
|
||||
title: "Error",
|
||||
description: errorMsg,
|
||||
variant: "destructive"
|
||||
} catch (error: unknown) {
|
||||
handleError(error, {
|
||||
action: isEditing ? 'Update Park' : 'Create Park',
|
||||
userId: user?.id,
|
||||
metadata: {
|
||||
parkName: data.name,
|
||||
hasLocation: !!data.location_id,
|
||||
hasNewOperator: !!tempNewOperator,
|
||||
hasNewOwner: !!tempNewPropertyOwner
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
|
||||
Reference in New Issue
Block a user