1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

delete empty inputs fields to clear error on credential form

This commit is contained in:
Haokun-Chen 2018-06-18 16:48:41 -04:00
parent 7aa835abd4
commit fe31f54778
No known key found for this signature in database
GPG Key ID: B2AA94BEF6591515
2 changed files with 6 additions and 0 deletions

View File

@ -62,6 +62,9 @@ function AddCredentialsController (models, $state, $scope, strings, componentsSt
delete data.inputs[gceFileInputSchema.id];
}
const filteredInputs = _.omit(data.inputs, (value) => value === '');
data.inputs = filteredInputs;
return credential.request('post', { data });
};

View File

@ -113,6 +113,9 @@ function EditCredentialsController (models, $state, $scope, strings, componentsS
delete data.inputs[gceFileInputSchema.id];
}
const filteredInputs = _.omit(data.inputs, (value) => value === '');
data.inputs = filteredInputs;
return credential.request('put', { data });
};