Skip to content

Commit

Permalink
fix submit when no input object defined
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemcdermott committed Nov 30, 2017
1 parent dbb9ffb commit 81f2184
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
};
Expand Down

0 comments on commit 81f2184

Please sign in to comment.