From 6066f441330108b99f160a80bef7fc63958356cc Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Fri, 25 Aug 2017 09:03:08 -0700 Subject: [PATCH] LP#1699566: fix barcode completion merge error Signed-off-by: Jeff Davis Signed-off-by: Jason Stephenson Signed-off-by: Kathy Lussier --- Open-ILS/web/js/ui/default/staff/cat/item/app.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/cat/item/app.js b/Open-ILS/web/js/ui/default/staff/cat/item/app.js index 97e387ad61..293e74ce5b 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/item/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/item/app.js @@ -48,8 +48,8 @@ angular.module('egItemStatus', }) .factory('itemSvc', - ['egCore', -function(egCore) { + ['egCore','egCirc', +function(egCore , egCirc) { var service = { copies : [], // copy barcode search results @@ -70,15 +70,6 @@ function(egCore) { } } - // resolved with the last received copy - service.fetch = function(barcode, id, noListDupes) { - var promise; - - if (barcode) { - promise = egCore.pcrud.search('acp', - {barcode : barcode, deleted : 'f'}, service.flesh); - } else { - promise = egCore.pcrud.retrieve('acp', id, service.flesh); //Retrieve separate copy, aacs, and accs information service.getCopy = function(barcode, id) { if (barcode) { @@ -87,12 +78,16 @@ function(egCore) { .then(function(actual_barcode) { return egCore.pcrud.search( 'acp', {barcode : actual_barcode, deleted : 'f'}, - service.flesh).then(function(copy) {return copy}); + service.flesh); }); } + return egCore.pcrud.retrieve( 'acp', id, service.flesh); + } + // resolved with the last received copy + service.fetch = function(barcode, id, noListDupes) { var lastRes; - return promise.then( + return service.getCopy(barcode, id).then( function() {return lastRes}, null, // error -- 2.11.0