LP#1621178: fix fleshing of copy status for available items
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 26 Apr 2017 13:59:07 +0000 (09:59 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Wed, 26 Apr 2017 14:03:04 +0000 (10:03 -0400)
Since copy status 0 means 'Available', test for null
explicitly.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/web/js/ui/default/staff/circ/services/holds.js

index 204d2a5..ab0b07d 100644 (file)
@@ -466,7 +466,8 @@ function($uibModal , $q , egCore , egConfirmDialog , egAlertDialog) {
             hold.current_copy(hold_data.copy);
             
             // likewise, current_copy's status isn't fleshed in the API
-            if(hold.current_copy().status() && typeof hold.current_copy().status() != 'object')
+            if(hold.current_copy().status() !== null &&
+               typeof hold.current_copy().status() != 'object')
                 egCore.pcrud.retrieve('ccs',hold.current_copy().status()
                     ).then(function(c) { hold.current_copy().status(c) });
         }