LP 1735539: Simplify item service selectedHoldingsCopyDelete.
authorJason Stephenson <jason@sigio.com>
Fri, 13 Apr 2018 13:38:39 +0000 (09:38 -0400)
committerJason Stephenson <jason@sigio.com>
Fri, 13 Apr 2018 13:38:39 +0000 (09:38 -0400)
Remove the var copy_objects and the unnecessary push of the results
into var copy_objects.

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

index c908e53..ccdfe8f 100644 (file)
@@ -499,16 +499,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(copies) {
-            angular.forEach(copies, function (copy) {
-                copy_objects.push(copy);
-            });
-        }).then(function() {
+        ).then(function(copy_objects) {
 
             var cnHash = {};
             var perCnCopies = {};