From bca8bddc768579d8a778dcd10453c39d31619767 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 28 Jan 2016 14:13:27 -0500 Subject: [PATCH] webstaff: fix updating stat cats in the volume/copy editor Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- .../web/js/ui/default/staff/cat/volcopy/app.js | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js index f52e88be96..760a56b5fa 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js @@ -891,26 +891,25 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , ); if (newval) { - var e = new egCore.idl.ascecm(); + var e = new egCore.idl.asce(); e.isnew( 1 ); - e.owning_copy( cp.id() ); e.stat_cat( id ); - e.stat_cat_entry( newval ); + e.id(newval); cp.stat_cat_entries( - cp.stat_cat_entries().concat([ e ]) + cp.stat_cat_entries() ? + cp.stat_cat_entries().concat([ e ]) : + [ e ] ); } - cp.stat_cat_entries( // trim out ephemeral deleted ones + // trim out all deleted ones; the API used to + // do the update doesn't actually consult + // isdeleted for stat cat entries + cp.stat_cat_entries( cp.stat_cat_entries().filter(function (e) { - if (Boolean(e.isnew())) { - if (Boolean(e.isdeleted())) { - return false; - } - } - return true; + return !Boolean(e.isdeleted()); }) ); @@ -1238,7 +1237,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , }); if (right_sc.length > 0) { - value_hash[right_sc[0].stat_cat_entry()] = right_sc[0].stat_cat_entry(); + value_hash[right_sc[0].id()] = right_sc[0].id(); } else { none = true; } -- 2.11.0