Merge pull request #743 from jakemcdermott/gcp-service-file

fix submit when no input object defined
This commit is contained in:
Jake McDermott 2017-11-29 20:50:24 -05:00 committed by GitHub
commit ee0aa40542
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -58,7 +58,9 @@ function AddCredentialsController (models, $state, $scope, strings, componentsSt
vm.form.save = data => {
data.user = me.get('id');
delete data.inputs[gceFileInputSchema.id];
if (_.get(data.inputs, gceFileInputSchema.id)) {
delete data.inputs[gceFileInputSchema.id];
}
return credential.request('post', { data });
};

View File

@ -108,7 +108,9 @@ function EditCredentialsController (models, $state, $scope, strings, componentsS
data.user = me.get('id');
credential.unset('inputs');
delete data.inputs[gceFileInputSchema.id];
if (_.get(data.inputs, gceFileInputSchema.id)) {
delete data.inputs[gceFileInputSchema.id];
}
return credential.request('put', { data });
};