Skip to content

Commit

Permalink
fix(charts): Correct graph if no agency
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Oct 31, 2024
1 parent 0734dd0 commit bdb375d
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ function useGetData(observationSnap, domain, split) {
(item) => item?.terms?.['bso_local_affiliations.keyword'],
);
query.query.bool.filter.splice(indexToDelete, 1);
queryFiltered.query.bool.filter.push({
term: { 'grants.agency.keyword': agency },
});
if (agency) {
queryFiltered.query.bool.filter.push({
term: { 'grants.agency.keyword': agency },
});
}
queries.push(Axios.post(ES_API_URL, queryFiltered, HEADERS));
queries.push(Axios.post(ES_API_URL, query, HEADERS));
const res = await Axios.all(queries);
Expand Down

0 comments on commit bdb375d

Please sign in to comment.