mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 05:29:26 -02:30
Let disassociate jt cred requests finish before attempting to associate any new ones
This commit is contained in:
@@ -38,14 +38,11 @@ function MultiCredentialService (Rest, ProcessErrors, $q, GetBasePath) {
|
||||
.filter(id => selected.indexOf(id) < 0)
|
||||
.map(id => disassociate({ related }, id));
|
||||
|
||||
const associationPromises = selected
|
||||
.filter(id => currentlyAssociated.indexOf(id) < 0)
|
||||
.map(id => associate({ related }, id));
|
||||
|
||||
const promises = disassociationPromises
|
||||
.concat(associationPromises);
|
||||
|
||||
return $q.all(promises);
|
||||
return $q.all(disassociationPromises).then(() => {
|
||||
_.each(selected.filter(id => currentlyAssociated.indexOf(id) < 0), (id) => {
|
||||
associate({related}, id);
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user