Merge pull request #1752 from mabashian/1466-workflow

Fixed bug checking for credentials to remove
This commit is contained in:
Michael Abashian 2018-05-14 16:06:06 -04:00 committed by GitHub
commit 32e78ed7b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,11 +221,15 @@ export default ['$scope', 'WorkflowService', 'GetBasePath', 'TemplatesService',
});
});
let credentialsToRemove = params.node.promptData.prompts.credentials.previousOverrides.filter(function(priorCred) {
return !credentialsNotInPriorCredentials.some(function(credNotInPrior) {
return priorCred.id === credNotInPrior.id;
let credentialsToRemove = [];
if (_.has(params, 'node.promptData.prompts.credentials.previousOverrides')) {
credentialsToRemove = params.node.promptData.prompts.credentials.previousOverrides.filter(function(priorCred) {
return !credentialsNotInPriorCredentials.some(function(credNotInPrior) {
return priorCred.id === credNotInPrior.id;
});
});
});
}
credentialsToAdd.forEach((credentialToAdd) => {
credentialRequests.push({