diff --git a/src/constants.js b/src/constants.js index f7e0989..cd15787 100644 --- a/src/constants.js +++ b/src/constants.js @@ -91,6 +91,7 @@ export const BENEFICIARY_STATUS_LIST = [ export const BENEFIT_PLAN_TYPE = { INDIVIDUAL: 'INDIVIDUAL', GROUP: 'GROUP', + EVERY_TYPE: 'EVERY_TYPE', }; export const BENEFIT_PLAN_TYPE_LIST = [BENEFIT_PLAN_TYPE.INDIVIDUAL, BENEFIT_PLAN_TYPE.GROUP]; diff --git a/src/pickers/BenefitPlanPicker.js b/src/pickers/BenefitPlanPicker.js index 2804b0b..109f483 100644 --- a/src/pickers/BenefitPlanPicker.js +++ b/src/pickers/BenefitPlanPicker.js @@ -50,9 +50,13 @@ function BenefitPlanPicker(props) { { skip: true }, ); - const benefitPlans = data?.benefitPlan?.edges - .map((edge) => edge.node) - .filter((node) => node.type === type) ?? []; + let benefitPlans = []; + const edges = data?.benefitPlan?.edges?.map((edge) => edge.node) ?? []; + if (type === BENEFIT_PLAN_TYPE.EVERY_TYPE) { + benefitPlans = edges; + } else { + benefitPlans = edges.filter((node) => node.type === type); + } const shouldShowTooltip = benefitPlans?.length >= BENEFIT_PLANS_QUANTITY_LIMIT && !value && !currentString; return (