Skip to content

Commit

Permalink
Merge pull request #49 from openimis/feature/OTC-800
Browse files Browse the repository at this point in the history
OTC-800: modular IMIS: renewing of free enrolment policies doesn't work
  • Loading branch information
delcroip committed Jul 6, 2023
2 parents e6d7ef2 + 8e978c5 commit d24eae2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
13 changes: 9 additions & 4 deletions src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
import _ from "lodash";
import { decodeId } from "@openimis/fe-core";

const FAMILY_HEAD_PROJECTION = "headInsuree{id,uuid,chfId,lastName,otherNames,email,phone,dob,gender{code}}";
const FAMILY_HEAD_PROJECTION =
"headInsuree{id,uuid,chfId,lastName,otherNames,email,phone,dob,gender{code}}";

const POLICY_BY_FAMILY_OR_INSUREE_PROJECTION = [
"policyUuid",
Expand Down Expand Up @@ -167,7 +168,7 @@ export function fetchPolicyFull(mm, policy_uuid) {
];
const payload = formatPageQuery(
"policies",
[`uuid: "${policy_uuid}"`, 'showHistory: true'],
[`uuid: "${policy_uuid}"`, "showHistory: true"],
projections
);
return graphql(payload, "POLICY_POLICY");
Expand Down Expand Up @@ -323,6 +324,10 @@ export function fetchFamily(mm, familyUuid, headInsureeChfId) {
} else {
filters.push(`headInsuree_ChfId: "${headInsureeChfId}"`);
}
const payload = formatPageQuery("families", filters, FAMILY_FULL_PROJECTION(mm));
const payload = formatPageQuery(
"families",
filters,
FAMILY_FULL_PROJECTION(mm)
);
return graphql(payload, "INSUREE_FAMILY_OVERVIEW");
};
}
7 changes: 1 addition & 6 deletions src/components/PolicyForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,8 @@ class PolicyForm extends Component {
lockNew: false,
newPolicy: !this.props.renew,
renew: false,
},
(e) => {
if (policy.stage === POLICY_STAGE_RENEW) {
policy.startDate = policy.expiryDate;
this.props.fetchPolicyValues(policy);
}
}

);
} else if (
!_.isEqual(prevState.policy.product, this.state.policy.product) ||
Expand Down

0 comments on commit d24eae2

Please sign in to comment.