Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,16 @@
...state,
fetchingPaymentPlans: false,
fetchedPaymentPlans: true,
paymentPlans: parseData(action.payload.data.paymentPlan),
paymentPlans: parseData(action.payload.data.paymentPlan)?.map((paymentPlan) => ({
...paymentPlan,
// benefitPlan is double-encoded by the backend (graphene JSONString
// wraps a json.dumps(...) result). Parse it here so consumers like
// PaymentPlanSearcher and the BenefitPlanPicker receive an object
// and can read code/name on the very first render.
benefitPlan: !!paymentPlan.benefitPlan

Check warning on line 290 in src/reducer.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Redundant double negation.

See more on https://sonarcloud.io/project/issues?id=openimis_openimis-fe-contribution_plan_js&issues=AZ2VIJcFZst1sdfeVaKF&open=AZ2VIJcFZst1sdfeVaKF&pullRequest=109

Check warning on line 290 in src/reducer.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Unexpected negated condition.

See more on https://sonarcloud.io/project/issues?id=openimis_openimis-fe-contribution_plan_js&issues=AZ2VIJcFZst1sdfeVaKE&open=AZ2VIJcFZst1sdfeVaKE&pullRequest=109
? JSON.parse(JSON.parse(paymentPlan.benefitPlan))
: null,
})),
paymentPlansPageInfo: pageInfo(action.payload.data.paymentPlan),
paymentPlansTotalCount: !!action.payload.data.paymentPlan
? action.payload.data.paymentPlan.totalCount
Expand Down
Loading