Skip to content

Commit

Permalink
Merge pull request #74 from woahdae/handle-certain-null-results
Browse files Browse the repository at this point in the history
Handle certain NULL query results
  • Loading branch information
maciejrybaniec authored May 15, 2020
2 parents 1020004 + 8d9772e commit a802009
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/utils/http-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const sendFetch = (method, config, options = {}) => {
} else if (responseJSON.result && Array.isArray(responseJSON.result)){
//interval and group by result
responseJSON.result.forEach((val) => {
if (!val) return;
if (!val.value) return val;
if (!Array.isArray(val.value)) return val.value;
val.value.forEach((res) => {
Expand All @@ -111,6 +112,7 @@ const sendFetch = (method, config, options = {}) => {
else {
//interval result
responseJSON.result.forEach((val) => {
if (!val) return;
if(!isNaN(Number(val.value))){
val.value = Number(val.value);
}
Expand All @@ -120,6 +122,7 @@ const sendFetch = (method, config, options = {}) => {
else {
//group by result
responseJSON.result.forEach((res) => {
if (!res) return;
if(!isNaN(Number(res.result))){
res.result = Number(res.result);
}
Expand Down

0 comments on commit a802009

Please sign in to comment.