Use my changes with mark missing.
authorJason Stephenson <jason@sigio.com>
Sat, 27 Oct 2018 00:19:48 +0000 (20:19 -0400)
committerJason Stephenson <jason@sigio.com>
Sat, 27 Oct 2018 00:19:48 +0000 (20:19 -0400)
Open-ILS/web/js/ui/default/staff/circ/services/circ.js
Open-ILS/web/js/ui/default/staff/circ/services/item.js

index df581d0..92d7c79 100644 (file)
@@ -1494,30 +1494,23 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
         });
     }
 
-    service.mark_missing = function(copy_ids) {
+    service.mark_missing = function(copies) {
         return egConfirmDialog.open(
             egCore.strings.MARK_MISSING_CONFIRM, '',
-            {   num_items : copy_ids.length,
+            {
+                num_items : copies.length,
                 ok : function() {},
                 cancel : function() {}
             }
         ).result.then(function() {
-            var promises = [];
-            angular.forEach(copy_ids, function(copy_id) {
-                promises.push(
-                    egCore.net.request(
-                        'open-ils.circ',
-                        'open-ils.circ.mark_item_missing',
-                        egCore.auth.token(), copy_id
-                    ).then(function(resp) {
-                        if (evt = egCore.evt.parse(resp)) {
-                            console.error('mark missing failed: ' + evt);
-                        }
-                    })
-                );
-            });
-
-            return $q.all(promises);
+            return egCore.pcrud.retrieve('ccs', 4)
+                .then(function(resp) {
+                    var promises = [];
+                    angular.forEach(copies, function(copy) {
+                        promises.push(service.mark_item(copy, resp, {}))
+                    });
+                    return $q.all(promises);
+                });
         });
     }
 
index 7a7d6c0..3326198 100644 (file)
@@ -651,7 +651,7 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
     }
 
     service.selectedHoldingsMissing = function (items) {
-        egCirc.mark_missing(items.map(function(el){return el.id;})).then(function(){
+        egCirc.mark_missing(items).then(function(){
             angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)});
         });
     }