Let servers validate invalid input

This commit is contained in:
olaservo 2025-09-27 21:05:00 -07:00
commit 69c294c0ae

View file

@ -252,13 +252,19 @@ const ToolsTab = ({
[key]: undefined, [key]: undefined,
}); });
} else { } else {
// Field has value - convert to number (never store strings) // Field has value - try to convert to number, but store input either way
const num = Number(value); const num = Number(value);
if (!isNaN(num)) { if (!isNaN(num)) {
setParams({ setParams({
...params, ...params,
[key]: num, [key]: num,
}); });
} else {
// Store invalid input as string - let server validate
setParams({
...params,
[key]: value,
});
} }
} }
}} }}