LP 1735539: Now with streaming action.
authorJason Stephenson <jason@sigio.com>
Fri, 13 Apr 2018 17:56:00 +0000 (13:56 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Thu, 19 Apr 2018 20:08:09 +0000 (16:08 -0400)
Modify item service selectedHoldingsCopyDelete method one more time to
use streaming response instead of getting all results in a single,
atomic call.  This should better handle large numbers of selected
items.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Jason Boyer <jboyer@library.in.gov>
Open-ILS/web/js/ui/default/staff/circ/services/item.js

index cc94639..be05ed5 100644 (file)
@@ -490,11 +490,11 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
     service.selectedHoldingsCopyDelete = function (items) {
         if (items.length == 0) return;
 
+        var copy_objects = [];
         egCore.pcrud.search('acp',
             {deleted : 'f', id : items.map(function(el){return el.id;}) },
-            { flesh : 1, flesh_fields : { acp : ['call_number'] } },
-            { atomic : true }
-        ).then(function(copy_objects) {
+            { flesh : 1, flesh_fields : { acp : ['call_number'] } }
+        ).then(function() {
 
             var cnHash = {};
             var perCnCopies = {};
@@ -544,6 +544,10 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
                     angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)});
                 });
             });
+        },
+        null,
+        function(copy) {
+            copy_objects.push(copy);
         });
     }