NIFI-4518:

- Addressing issues when handling the done callback for controller service references.
This commit is contained in:
Matt Gilman 2017-10-26 12:43:02 -04:00
parent 32c0e2be3b
commit f2bd9f87ba
No known key found for this signature in database
GPG Key ID: DF61EC19432AEE37
2 changed files with 8 additions and 3 deletions

View File

@ -284,7 +284,13 @@
if (queries.length === 1) {
// if there was only one query, return it
return queries[0].fail(nfErrorHandler.handleAjaxError);
return $.Deferred(function (deferred) {
queries[0].done(function (response) {
deferred.resolve(response);
}).fail(function () {
deferred.reject();
}).fail(nfErrorHandler.handleAjaxError);
}).promise();
} else {
// if there were multiple queries, wait for each to complete
return $.Deferred(function (deferred) {

View File

@ -864,8 +864,7 @@
dataType: 'json'
});
$.when(bulletins, service).done(function (bulletinResult, serviceResult) {
var bulletinResponse = bulletinResult[0];
$.when(bulletins, service).done(function (bulletinResponse, serviceResult) {
var serviceResponse = serviceResult[0];
conditionMet(serviceResponse.component, bulletinResponse.bulletinBoard.bulletins);
}).fail(function (xhr, status, error) {