});
}
- 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);
+ });
});
}
}
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)});
});
}