From 4fc2271d2415a242aa6c027dad0f7be710e1bf97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rialland?= Date: Thu, 7 Apr 2022 18:53:43 +0200 Subject: [PATCH] Fix type of delete from situation --- site/source/reducers/companySituationReducer.ts | 4 +--- site/source/reducers/rootReducer.ts | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) 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