mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 21:11:12 -05:00
Refactor: Execute remaining phases
This commit is contained in:
@@ -19,6 +19,7 @@ import { FlexibleDateInput, type DatePrecision } from '@/components/ui/flexible-
|
||||
import { submitOperatorCreation, submitOperatorUpdate } from '@/lib/entitySubmissionHelpers';
|
||||
import { useAuth } from '@/hooks/useAuth';
|
||||
import { toast } from 'sonner';
|
||||
import { handleError } from '@/lib/errorHandler';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import type { UploadedImage } from '@/types/company';
|
||||
|
||||
@@ -113,9 +114,11 @@ export function OperatorForm({ onSubmit, onCancel, initialData }: OperatorFormPr
|
||||
toast.success('Operator submitted for review');
|
||||
onCancel();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Submission error:', error);
|
||||
toast.error(error instanceof Error ? error.message : 'Failed to submit operator');
|
||||
} catch (error: unknown) {
|
||||
handleError(error, {
|
||||
action: initialData?.id ? 'Update Operator' : 'Create Operator',
|
||||
metadata: { companyName: data.name }
|
||||
});
|
||||
} finally {
|
||||
setIsSubmitting(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user