From 23baef196741e0a0167be65dbfe6993897ec8c40 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Sun, 21 Oct 2018 13:02:14 -0400 Subject: [PATCH] Try actually marking the copies now. --- .../web/js/ui/default/staff/circ/services/circ.js | 35 +++++++++++----------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js index 86dde06ad8..35dfef60cd 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js @@ -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; }); } -- 2.11.0