From cb1425e3295ae90fa3644bc0af104447d8ff9f74 Mon Sep 17 00:00:00 2001 From: Llewellyn Marshall Date: Tue, 17 Jan 2023 14:57:53 -0500 Subject: [PATCH] throw out NaN data for numeric fields, do not let them become null. --- .../eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts index 832e4cbfbd..a9409a9305 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts @@ -294,10 +294,7 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit { !this.copyWantsChange(copy, field, changeSelection)) { return; } - if(!value) - copy[field](null); - else - copy[field](value); + copy[field](value); copy.ischanged(true); }); } @@ -605,9 +602,12 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit { promise = this.volcopy.getLocation(value); } - if ((field === 'cost' || field === 'price' || field === 'deposit_amount') && value){ + if ((field === 'cost' || field === 'price' || field === 'deposit_amount')){ // Make sure monetary fields are properly cast as numeric values - promise = Promise.resolve(Number(value)); + // and discard if no cast possible. + let n = Number(value); + if(isNaN(n)){return;} + promise = Promise.resolve(n); } promise.then(val => { -- 2.11.0