diff --git a/site/source/reducers/companySituationReducer.ts b/site/source/reducers/companySituationReducer.ts index 324e2c0f2..0badedc85 100644 --- a/site/source/reducers/companySituationReducer.ts +++ b/site/source/reducers/companySituationReducer.ts @@ -40,9 +40,7 @@ export function companySituation(state: Situation = {}, action: Action) { } break case 'DELETE_FROM_SITUATION': { - const newState = omit({ ...state }, action.fieldName) - - return newState + return omit({ ...state }, action.fieldName) as Situation } case 'COMPANY::SET_EXISTING_COMPANY': return getCompanySituation(action.entreprise) diff --git a/site/source/reducers/rootReducer.ts b/site/source/reducers/rootReducer.ts index 8b55fe61a..8640a620c 100644 --- a/site/source/reducers/rootReducer.ts +++ b/site/source/reducers/rootReducer.ts @@ -142,8 +142,8 @@ function simulation( ...state, situation: omit( { ...state.situation }, - action.fieldName as keyof Simulation['situation'] - ), + action.fieldName + ) as Simulation['situation'], } return newState