From 71c8c5c60c8aae02ce7216d3da0c2ed919d11b49 Mon Sep 17 00:00:00 2001 From: Nikhil Woodruff <35577657+nikhilwoodruff@users.noreply.github.com> Date: Fri, 20 Oct 2023 17:05:10 +0100 Subject: [PATCH] Re-add monthly and eternity variables (#756) * Re-add monthly and eternity variables * Lint --- src/pages/household/input/VariableEditor.jsx | 2 +- src/pages/household/output/EarningsVariation.jsx | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/household/input/VariableEditor.jsx b/src/pages/household/input/VariableEditor.jsx index 8cba23d9f..0136bdfdd 100644 --- a/src/pages/household/input/VariableEditor.jsx +++ b/src/pages/household/input/VariableEditor.jsx @@ -305,7 +305,7 @@ export function addVariable(householdInput, variable, entityPlural) { let possibleEntities = null; // If the variable is defined as occurring over a year... - if (variable.definitionPeriod === "year") { + if (["year", "eternity"].includes(variable.definitionPeriod)) { // If plural entity term is in household situation... if (entityPlural in householdInput) { // Pull all individual entities stored within the umbrella entity diff --git a/src/pages/household/output/EarningsVariation.jsx b/src/pages/household/output/EarningsVariation.jsx index 00e2b4503..110d0aed9 100644 --- a/src/pages/household/output/EarningsVariation.jsx +++ b/src/pages/household/output/EarningsVariation.jsx @@ -59,8 +59,7 @@ export default function EarningsVariation(props) { useEffect(() => { let householdData = JSON.parse(JSON.stringify(householdInput)); - console.log(householdInput); - householdData.people.you.employment_income["2023"] = null; + householdData.people.you["employment_income"] = { 2023: null }; const currentEarnings = getValueFromHousehold( "employment_income", "2023",