mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 11:31:13 -05:00
Fix edge function console statements
This commit is contained in:
@@ -86,14 +86,14 @@ export function CoasterStatsEditor({
|
||||
onChange(newStats.map((stat, i) => ({ ...stat, display_order: i })));
|
||||
};
|
||||
|
||||
const updateStat = (index: number, field: keyof CoasterStat, value: any) => {
|
||||
const updateStat = (index: number, field: keyof CoasterStat, value: string | number | boolean | null | undefined) => {
|
||||
const newStats = [...stats];
|
||||
|
||||
// Ensure unit is metric when updating unit field
|
||||
if (field === 'unit' && value) {
|
||||
if (field === 'unit' && value && typeof value === 'string') {
|
||||
try {
|
||||
validateMetricUnit(value, 'Unit');
|
||||
newStats[index] = { ...newStats[index], [field]: value };
|
||||
newStats[index] = { ...newStats[index], unit: value };
|
||||
// Clear error for this index
|
||||
setUnitErrors(prev => {
|
||||
const updated = { ...prev };
|
||||
|
||||
@@ -40,7 +40,7 @@ export function FormerNamesEditor({ names, onChange, currentName }: FormerNamesE
|
||||
onChange(newNames.map((name, i) => ({ ...name, order_index: i })));
|
||||
};
|
||||
|
||||
const updateName = (index: number, field: keyof FormerName, value: any) => {
|
||||
const updateName = (index: number, field: keyof FormerName, value: string | number | Date | null | undefined) => {
|
||||
const newNames = [...names];
|
||||
newNames[index] = { ...newNames[index], [field]: value };
|
||||
onChange(newNames);
|
||||
|
||||
@@ -64,14 +64,14 @@ export function TechnicalSpecsEditor({
|
||||
onChange(newSpecs.map((spec, i) => ({ ...spec, display_order: i })));
|
||||
};
|
||||
|
||||
const updateSpec = (index: number, field: keyof TechnicalSpec, value: any) => {
|
||||
const updateSpec = (index: number, field: keyof TechnicalSpec, value: string | number | boolean | null | undefined) => {
|
||||
const newSpecs = [...specs];
|
||||
|
||||
// Ensure unit is metric when updating unit field
|
||||
if (field === 'unit' && value) {
|
||||
if (field === 'unit' && value && typeof value === 'string') {
|
||||
try {
|
||||
validateMetricUnit(value, 'Unit');
|
||||
newSpecs[index] = { ...newSpecs[index], [field]: value };
|
||||
newSpecs[index] = { ...newSpecs[index], unit: value };
|
||||
// Clear error for this index
|
||||
setUnitErrors(prev => {
|
||||
const updated = { ...prev };
|
||||
|
||||
Reference in New Issue
Block a user