Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Commit

Permalink
Merge pull request #41 from TakwimuAfrica/hotfix/geoid-avail
Browse files Browse the repository at this point in the history
[HotFix] Use Query variable checks
  • Loading branch information
KhadijaMahanga authored Jan 15, 2020
2 parents 56cd5af + 1a5d501 commit b6f742c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions wp-content/plugins/hurumap/src/HURUmapBlock/Chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ function Chart({
const { loading: sourceLoading, data: sourceData } = useQuery(
GET_CHART_SOURCE,
{
skip: Boolean(geoId),
variables: {
geoLevel: geoId.split('-')[0],
countryCode: geoId.split('-')[1].slice(0, 2),
tableName: chart.visual.table
geoLevel: geoId ? geoId.split('-')[0] : '',
countryCode: geoId ? geoId.split('-')[1].slice(0, 2) : '',
tableName: chart && chart.visual ? chart.visual.table : ''
}
}
);
Expand Down

0 comments on commit b6f742c

Please sign in to comment.