From 029b7b7e017ef03e8555b9361f6fd6f668b5d28e Mon Sep 17 00:00:00 2001 From: Joshua Sigona Date: Sun, 22 Aug 2021 07:52:00 +0900 Subject: [PATCH] Test if field is blank when submitting. --- src/App.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/App.js b/src/App.js index 45a5f6c..f52978a 100644 --- a/src/App.js +++ b/src/App.js @@ -151,6 +151,11 @@ function TableEditor(p) { useEffect(()=>{ var promises=[] parse(fileData,{columns:true,skip_empty_lines:true}).forEach((entry)=>{ + for (var col of fields) { + if (col.dataTypeID===23&&entry[col.name]==="") { + entry[col.name]=0 + } + } promises.push(axios.post(p.BACKENDURL+p.path,{...entry,pass:p.password})) }) Promise.allSettled(promises)