From 7818378238b8013d87720ae6cffed81b06c92cbe Mon Sep 17 00:00:00 2001 From: Robert Rytovuori Date: Wed, 26 Jun 2024 09:24:59 +0300 Subject: [PATCH 1/2] fix typescript errors --- src/creditDecision/reducer.ts | 6 +----- src/creditDecision/types.ts | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/creditDecision/reducer.ts b/src/creditDecision/reducer.ts index 9d7f7ff8e..7b40f31bd 100644 --- a/src/creditDecision/reducer.ts +++ b/src/creditDecision/reducer.ts @@ -8,7 +8,7 @@ const isFetchingHistoryByBusinessIdReducer: Reducer = hand }: FetchHistoryByBusinessIdAction) => ({ ...state, [id]: true }), - // @ts-ignore: No overload matches this call + ['mvj/creditDecision/RECEIVE_HISTORY_BY_BUSINESS_ID']: (state: IsFetchingHistoryMap, { payload }: ReceiveHistoryByBusinessIdAction) => ({ ...state, @@ -35,7 +35,6 @@ const isFetchingHistoryByContactIdReducer: Reducer = handl }: FetchHistoryByContactIdAction) => ({ ...state, [id]: true }), - // @ts-ignore: No overload matches this call ['mvj/creditDecision/RECEIVE_HISTORY_BY_CONTACT_ID']: (state: IsFetchingHistoryMap, { payload }: ReceiveHistoryByContactIdAction) => ({ ...state, @@ -62,7 +61,6 @@ const isFetchingCreditDecisionByBusinessIdReducer: Reducer ({ ...state, [id]: true }), - // @ts-ignore: No overload matches this call ['mvj/creditDecision/RECEIVE_CREDIT_DECISION_BY_BUSINESS_ID']: (state: IsFetchingCreditDecisionMap, { payload }: ReceiveCreditDecisionByBusinessIdAction) => ({ ...state, @@ -89,7 +87,6 @@ const isFetchingCreditDecisionByContactIdReducer: Reducer ({ ...state, [id]: true }), - // @ts-ignore: No overload matches this call ['mvj/creditDecision/RECEIVE_CREDIT_DECISION_BY_CONTACT_ID']: (state: IsFetchingCreditDecisionMap, { payload }: ReceiveCreditDecisionByContactIdAction) => ({ ...state, @@ -116,7 +113,6 @@ const isFetchingCreditDecisionByNinReducer: Reducer }: FetchCreditDecisionByNinAction) => ({ ...state, [id]: true }), - // @ts-ignore: No overload matches this call ['mvj/creditDecision/RECEIVE_CREDIT_DECISION_BY_NIN']: (state: IsFetchingCreditDecisionMap, { payload }: ReceiveCreditDecisionByNinAction) => ({ ...state, diff --git a/src/creditDecision/types.ts b/src/creditDecision/types.ts index 6ac133e6b..f93c08dc0 100644 --- a/src/creditDecision/types.ts +++ b/src/creditDecision/types.ts @@ -11,9 +11,9 @@ export type CreditDecisionState = { isFetchingHistoryByBusinessId: IsFetchingHistoryMap; isFetchingHistoryByContactId: IsFetchingHistoryMap; }; -export type HistoryDataMap = Record>; +export type HistoryDataMap = any; export type IsFetchingHistoryMap = Record; -export type CreditDecisionDataMap = Record>; +export type CreditDecisionDataMap = any; export type IsFetchingCreditDecisionMap = Record; export type FetchHistoryByBusinessIdAction = Action; export type FetchHistoryByContactIdAction = Action; From 1f4958056b63f9d9483f61030e649934bcaf97ac Mon Sep 17 00:00:00 2001 From: Robert Rytovuori Date: Thu, 27 Jun 2024 09:32:24 +0300 Subject: [PATCH 2/2] moving any away from types and closer to problem creditDecision --- src/creditDecision/reducer.ts | 10 +++++----- src/creditDecision/types.ts | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/creditDecision/reducer.ts b/src/creditDecision/reducer.ts index 7b40f31bd..b72a074a0 100644 --- a/src/creditDecision/reducer.ts +++ b/src/creditDecision/reducer.ts @@ -12,7 +12,7 @@ const isFetchingHistoryByBusinessIdReducer: Reducer = hand ['mvj/creditDecision/RECEIVE_HISTORY_BY_BUSINESS_ID']: (state: IsFetchingHistoryMap, { payload }: ReceiveHistoryByBusinessIdAction) => ({ ...state, - ...Object.keys(payload).reduce((obj, key) => ({ ...obj, + ...Object.keys(payload).reduce((obj: any, key) => ({ ...obj, [key]: false }), {}) }), @@ -38,7 +38,7 @@ const isFetchingHistoryByContactIdReducer: Reducer = handl ['mvj/creditDecision/RECEIVE_HISTORY_BY_CONTACT_ID']: (state: IsFetchingHistoryMap, { payload }: ReceiveHistoryByContactIdAction) => ({ ...state, - ...Object.keys(payload).reduce((obj, key) => ({ ...obj, + ...Object.keys(payload).reduce((obj: any, key) => ({ ...obj, [key]: false }), {}) }), @@ -64,7 +64,7 @@ const isFetchingCreditDecisionByBusinessIdReducer: Reducer ({ ...state, - ...Object.keys(payload).reduce((obj, key) => ({ ...obj, + ...Object.keys(payload).reduce((obj: any, key) => ({ ...obj, [key]: false }), {}) }), @@ -90,7 +90,7 @@ const isFetchingCreditDecisionByContactIdReducer: Reducer ({ ...state, - ...Object.keys(payload).reduce((obj, key) => ({ ...obj, + ...Object.keys(payload).reduce((obj: any, key) => ({ ...obj, [key]: false }), {}) }), @@ -116,7 +116,7 @@ const isFetchingCreditDecisionByNinReducer: Reducer ['mvj/creditDecision/RECEIVE_CREDIT_DECISION_BY_NIN']: (state: IsFetchingCreditDecisionMap, { payload }: ReceiveCreditDecisionByNinAction) => ({ ...state, - ...Object.keys(payload).reduce((obj, key) => ({ ...obj, + ...Object.keys(payload).reduce((obj: any, key) => ({ ...obj, [key]: false }), {}) }), diff --git a/src/creditDecision/types.ts b/src/creditDecision/types.ts index f93c08dc0..76c141543 100644 --- a/src/creditDecision/types.ts +++ b/src/creditDecision/types.ts @@ -11,9 +11,9 @@ export type CreditDecisionState = { isFetchingHistoryByBusinessId: IsFetchingHistoryMap; isFetchingHistoryByContactId: IsFetchingHistoryMap; }; -export type HistoryDataMap = any; +export type HistoryDataMap = Record; export type IsFetchingHistoryMap = Record; -export type CreditDecisionDataMap = any; +export type CreditDecisionDataMap = Record; export type IsFetchingCreditDecisionMap = Record; export type FetchHistoryByBusinessIdAction = Action; export type FetchHistoryByContactIdAction = Action;