1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-14 00:19:16 +01:00

fix: addon parameter validation on empty strings (#2547)

https://linear.app/unleash/issue/2-408/addon-parameter-validation
This commit is contained in:
Nuno Góis 2022-11-29 08:22:58 +00:00 committed by GitHub
parent 4518ed6642
commit fc9cad12ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,9 +130,13 @@ export const AddonForm: VFC<IAddonFormProps> = ({
(param: string): ChangeEventHandler<HTMLInputElement> =>
event => {
event.preventDefault();
const value =
trim(event.target.value) === ''
? undefined
: event.target.value;
setFormValues(
produce(draft => {
draft.parameters[param] = event.target.value;
draft.parameters[param] = value;
})
);
};