ui: submit form with false boolean params (#5224)

Skip only empty strings while submitting UI form.
Fixes #5223

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2021-07-27 15:03:45 +05:30 committed by GitHub
parent 8ed5a4fae6
commit 6540d9965b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -995,15 +995,15 @@ export default {
if (param.name !== key) {
continue
}
if (!input === undefined || input === null ||
if (input === undefined || input === null ||
(input === '' && !['updateStoragePool', 'updateHost', 'updatePhysicalNetwork', 'updateDiskOffering', 'updateNetworkOffering'].includes(action.api))) {
if (param.type === 'boolean') {
params[key] = false
}
break
}
if (!input && input !== 0 && !['tags'].includes(key)) {
continue
if (input === '' && !['tags'].includes(key)) {
break
}
if (action.mapping && key in action.mapping && action.mapping[key].options) {
params[key] = action.mapping[key].options[input]