Skip to content

Commit 69c294c

Browse files
committed
Let servers validate invalid input
1 parent a4f99bd commit 69c294c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

client/src/components/ToolsTab.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,19 @@ const ToolsTab = ({
252252
[key]: undefined,
253253
});
254254
} else {
255-
// Field has value - convert to number (never store strings)
255+
// Field has value - try to convert to number, but store input either way
256256
const num = Number(value);
257257
if (!isNaN(num)) {
258258
setParams({
259259
...params,
260260
[key]: num,
261261
});
262+
} else {
263+
// Store invalid input as string - let server validate
264+
setParams({
265+
...params,
266+
[key]: value,
267+
});
262268
}
263269
}
264270
}}

0 commit comments

Comments
 (0)