From: Jeff Davis Date: Thu, 21 Apr 2022 17:48:15 +0000 (-0700) Subject: LP#1932203: serialize requests on Edit Due Date in Items Out tab X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=92b75f94aa82176338084deb200be6fc9cb43820;p=evergreen%2Ftadl.git LP#1932203: serialize requests on Edit Due Date in Items Out tab Signed-off-by: Jeff Davis Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js index eaf53f31af..b2988c50aa 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js @@ -354,11 +354,12 @@ function($scope , $q , $routeParams , $timeout , egCore , egUser , patronSvc , $scope.ok = function(args) { var due = $scope.args.due_date.toISOString(); console.debug("applying due date of " + due); + egProgressDialog.open(); - var promises = []; + var promise = $q.when(); angular.forEach(items, function(circ) { - promises.push( - egCore.net.request( + promise = promise.then(function() { + return egCore.net.request( 'open-ils.circ', 'open-ils.circ.circulation.due_date.update', egCore.auth.token(), circ.id(), due @@ -368,10 +369,11 @@ function($scope , $q , $routeParams , $timeout , egCore , egUser , patronSvc , // date from the modified circulation. circ.due_date(new_circ.due_date()); }) - ); + }); }); - $q.all(promises).then(function() { + promise.finally(function() { + egProgressDialog.close(); $uibModalInstance.close(); provider.refresh(); });