LP1734775: Show multiple items in Item Status user/jboyer/lp1734775_multi_item_list
authorJason Boyer <jboyer@library.in.gov>
Thu, 17 Jan 2019 14:58:08 +0000 (09:58 -0500)
committerJason Boyer <jboyer@library.in.gov>
Thu, 17 Jan 2019 14:58:08 +0000 (09:58 -0500)
The ListCtrl controller was only displaying a single
copy when an id list was passed to Item Status in the
URL. This branch separates each id into a separate
fetch call and when all have been resolved it
refreshes the grid, which now has all of the items.

Signed-off-by: Jason Boyer <jboyer@library.in.gov>
Open-ILS/web/js/ui/default/staff/cat/item/app.js

index 19e45f9..840a40a 100644 (file)
@@ -559,11 +559,12 @@ function($scope , $q , $routeParams , $location , $timeout , $window , egCore ,
     }
 
     if (copyId.length > 0) {
-        itemSvc.fetch(null,copyId).then(
-            function() {
-                copyGrid.refresh();
-            }
-        );
+        var fetch_list = [];
+        angular.forEach(copyId, function (c) {
+            fetch_list.push(itemSvc.fetch(null,c));
+        });
+
+        return $q.all(fetch_list).then(function (res) { copyGrid.refresh(); });
     }
 
 }])