Skip to content

Commit

Permalink
Merge pull request #2 from openimis/bug/payer-picker-filter
Browse files Browse the repository at this point in the history
Filters missing on api call
  • Loading branch information
edarchis authored Aug 31, 2021
2 parents 798c416 + 742d4fa commit 6a5de3b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,20 @@ import {
import _ from "lodash";
import _uuid from "lodash-uuid";

export function fetchPayers(mm, filters = []) {
export function fetchPayers(mm, hf, str, prev) {
var filters = [];
if (!!hf) {
filters.push(`healthFacility_Uuid: "${hf.uuid}"`)
}
if (!!str) {
filters.push(`str: "${str}"`)
}
if (_.isEqual(filters, prev)) {
return (dispatch) => { }
}
const payload = formatPageQuery(
"payers",
null,
filters,
mm.getRef("payer.PayerPicker.projection")
);
return graphql(payload, 'PAYER_PAYERS', filters);
Expand Down

0 comments on commit 6a5de3b

Please sign in to comment.