Fix edge function console statements

This commit is contained in:
gpt-engineer-app[bot]
2025-11-03 19:16:06 +00:00
parent c0f468451f
commit ba6bb8a317
9 changed files with 78 additions and 76 deletions

View File

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