diff --git a/process/payments/reactions.ts b/process/payments/reactions.ts index 9dd1841..a6ee205 100644 --- a/process/payments/reactions.ts +++ b/process/payments/reactions.ts @@ -214,10 +214,9 @@ export default function paymentsReactions( /** * Дегрессия */ - const mapGraphTypeToSeasonTypes: { [key: number]: Array } = { - 100_000_001: [100_000_003, 100_000_004, 100_000_005, 100_000_006, 100_000_007], - 100_000_003: [100_000_000, 100_000_001, 100_000_002], - }; + const degressionSeasonTypes = new Set([ + 100_000_003, 100_000_004, 100_000_005, 100_000_006, 100_000_007, + ]); reaction( () => { @@ -226,15 +225,14 @@ export default function paymentsReactions( return graphType; }, (graphType) => { - if (!graphType) { + if (!graphType || graphType !== 100_000_001) { $calculation.setElementOptions('selectSeasonType', []); return; } - const allowedSeasonTypes = mapGraphTypeToSeasonTypes[graphType]; const selectSeasonTypeOptions = selectSeasonType.filter((option) => - allowedSeasonTypes.includes(option.value) + degressionSeasonTypes.has(option.value) ); $calculation.setElementOptions('selectSeasonType', selectSeasonTypeOptions); }