LP#1659181 Mark Items Damaged Prompt
[evergreen-equinox.git] / Open-ILS / web / js / ui / default / staff / cat / catalog / app.js
index 33af100..95c1dd3 100644 (file)
@@ -1542,9 +1542,18 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
     }
 
     $scope.selectedHoldingsDamaged = function () {
-        egCirc.mark_damaged(gatherSelectedHoldingsIds()).then(function() {
-            holdingsSvcInst.fetchAgain().then(function() {
-                $scope.holdingsGridDataProvider.refresh();
+        var copy_list = gatherSelectedRawCopies();
+        if (copy_list.length == 0) return;
+
+        angular.forEach(copy_list, function(cp) {
+            egCirc.mark_damaged({
+                id: cp.id(),
+                barcode: cp.barcode(),
+                circ_lib: cp.circ_lib().id()
+            }).then(function() {
+                holdingsSvcInst.fetchAgain().then(function() {
+                    $scope.holdingsGridDataProvider.refresh();
+                });
             });
         });
     }