mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 22:31:13 -05:00
Refactor: Implement type safety plan
This commit is contained in:
@@ -18,6 +18,7 @@ import { RideForm } from '@/components/admin/RideForm';
|
||||
import { ManufacturerForm } from '@/components/admin/ManufacturerForm';
|
||||
import { DesignerForm } from '@/components/admin/DesignerForm';
|
||||
import { OperatorForm } from '@/components/admin/OperatorForm';
|
||||
import { jsonToFormData } from '@/lib/typeConversions';
|
||||
import { PropertyOwnerForm } from '@/components/admin/PropertyOwnerForm';
|
||||
import { RideModelForm } from '@/components/admin/RideModelForm';
|
||||
import { Save, X, Edit } from 'lucide-react';
|
||||
@@ -129,8 +130,9 @@ export function ItemEditDialog({ item, items, open, onOpenChange, onComplete }:
|
||||
<ParkForm
|
||||
onSubmit={handleSubmit}
|
||||
onCancel={() => onOpenChange(false)}
|
||||
// Convert Json to form-compatible object (null → undefined)
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
initialData={itemData as any}
|
||||
initialData={jsonToFormData(editItem.item_data) as any}
|
||||
isEditing
|
||||
/>
|
||||
);
|
||||
@@ -140,8 +142,9 @@ export function ItemEditDialog({ item, items, open, onOpenChange, onComplete }:
|
||||
<RideForm
|
||||
onSubmit={handleSubmit}
|
||||
onCancel={() => onOpenChange(false)}
|
||||
// Convert Json to form-compatible object (null → undefined)
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
initialData={itemData as any}
|
||||
initialData={jsonToFormData(editItem.item_data) as any}
|
||||
isEditing
|
||||
/>
|
||||
);
|
||||
@@ -152,7 +155,7 @@ export function ItemEditDialog({ item, items, open, onOpenChange, onComplete }:
|
||||
onSubmit={handleSubmit}
|
||||
onCancel={() => onOpenChange(false)}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
initialData={itemData as any}
|
||||
initialData={jsonToFormData(editItem.item_data) as any}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -162,7 +165,7 @@ export function ItemEditDialog({ item, items, open, onOpenChange, onComplete }:
|
||||
onSubmit={handleSubmit}
|
||||
onCancel={() => onOpenChange(false)}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
initialData={itemData as any}
|
||||
initialData={jsonToFormData(editItem.item_data) as any}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -172,7 +175,7 @@ export function ItemEditDialog({ item, items, open, onOpenChange, onComplete }:
|
||||
onSubmit={handleSubmit}
|
||||
onCancel={() => onOpenChange(false)}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
initialData={itemData as any}
|
||||
initialData={jsonToFormData(editItem.item_data) as any}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -182,7 +185,7 @@ export function ItemEditDialog({ item, items, open, onOpenChange, onComplete }:
|
||||
onSubmit={handleSubmit}
|
||||
onCancel={() => onOpenChange(false)}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
initialData={itemData as any}
|
||||
initialData={jsonToFormData(editItem.item_data) as any}
|
||||
/>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user