Try actually marking the copies now.
authorJason Stephenson <jason@sigio.com>
Sun, 21 Oct 2018 17:02:14 +0000 (13:02 -0400)
committerJason Stephenson <jason@sigio.com>
Fri, 26 Oct 2018 23:04:56 +0000 (19:04 -0400)
Open-ILS/web/js/ui/default/staff/circ/services/circ.js

index 86dde06..35dfef6 100644 (file)
@@ -1412,36 +1412,35 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
             break;
         }
 
-        function get_status(ids) {
+        function get_status(statusID) {
             var deferred = $q.defer()
-            egCore.pcrud.search('ccs', {id: ids})
+            egCore.pcrud.retrieve('ccs', statusID)
                 .then(function(resp) {
                     deferred.resolve(resp);
                 }, function(resp) {
                     deferred.reject(resp);
-                }, function(resp) {
-                    deferred.notify(resp);
                 });
             return deferred.promise;
         }
 
-        var newStatus, oldStatus;
-        return get_status([markstatus,copy['status.id']]).then(function(resp) {
-            return egConfirmDialog.open(
-                'Mark Item ' + newStatus.name(),
-                'From ' + oldStatus.name(),
-                {
-                    ok : function() {},
-                    cancel : function() {}
+        var newStatus;
+        return get_status(markstatus).then(function(resp) {
+            newStatus = resp;
+            return egCore.net.request(
+                'open-ils.circ',
+                req,
+                egCore.auth.token(),
+                copy.id,
+                args
+            ).then(function(resp) {
+                if (resp == 1) {
+                    console.debug(req + ' succeeded for ' + copy.barcode);
+                } else if (evt = egCore.evt.parse(resp)) {
+                    console.error(req + ' failed for ' + copy.barcode + ': ' + resp.textcode);
                 }
-            ).result;
+            });
         }, function(resp) {
             /* noop */
-        }, function(resp) {
-            if (resp.id() == markstatus)
-                newStatus = resp;
-            else
-                oldStatus = resp;
         });
     }