Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typescript errors #495

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions src/creditDecision/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ const isFetchingHistoryByBusinessIdReducer: Reducer<IsFetchingHistoryMap> = hand
}: FetchHistoryByBusinessIdAction) => ({ ...state,
[id]: true
}),
// @ts-ignore: No overload matches this call

['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
}), {})
}),
Expand All @@ -35,11 +35,10 @@ const isFetchingHistoryByContactIdReducer: Reducer<IsFetchingHistoryMap> = handl
}: FetchHistoryByContactIdAction) => ({ ...state,
[id]: true
}),
// @ts-ignore: No overload matches this call
['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
}), {})
}),
Expand All @@ -62,11 +61,10 @@ const isFetchingCreditDecisionByBusinessIdReducer: Reducer<IsFetchingCreditDecis
}: FetchCreditDecisionByBusinessIdAction) => ({ ...state,
[id]: true
}),
// @ts-ignore: No overload matches this call
['mvj/creditDecision/RECEIVE_CREDIT_DECISION_BY_BUSINESS_ID']: (state: IsFetchingCreditDecisionMap, {
payload
}: ReceiveCreditDecisionByBusinessIdAction) => ({ ...state,
...Object.keys(payload).reduce((obj, key) => ({ ...obj,
...Object.keys(payload).reduce((obj: any, key) => ({ ...obj,
[key]: false
}), {})
}),
Expand All @@ -89,11 +87,10 @@ const isFetchingCreditDecisionByContactIdReducer: Reducer<IsFetchingCreditDecisi
}: FetchCreditDecisionByContactIdAction) => ({ ...state,
[id]: true
}),
// @ts-ignore: No overload matches this call
['mvj/creditDecision/RECEIVE_CREDIT_DECISION_BY_CONTACT_ID']: (state: IsFetchingCreditDecisionMap, {
payload
}: ReceiveCreditDecisionByContactIdAction) => ({ ...state,
...Object.keys(payload).reduce((obj, key) => ({ ...obj,
...Object.keys(payload).reduce((obj: any, key) => ({ ...obj,
[key]: false
}), {})
}),
Expand All @@ -116,11 +113,10 @@ const isFetchingCreditDecisionByNinReducer: Reducer<IsFetchingCreditDecisionMap>
}: FetchCreditDecisionByNinAction) => ({ ...state,
[id]: true
}),
// @ts-ignore: No overload matches this call
['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
}), {})
}),
Expand Down
4 changes: 2 additions & 2 deletions src/creditDecision/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export type CreditDecisionState = {
isFetchingHistoryByBusinessId: IsFetchingHistoryMap;
isFetchingHistoryByContactId: IsFetchingHistoryMap;
};
export type HistoryDataMap = Record<string, Record<string, any>>;
export type HistoryDataMap = Record<string, any>;
export type IsFetchingHistoryMap = Record<string, boolean>;
export type CreditDecisionDataMap = Record<string, Record<string, any>>;
export type CreditDecisionDataMap = Record<string, any>;
export type IsFetchingCreditDecisionMap = Record<string, boolean>;
export type FetchHistoryByBusinessIdAction = Action<string, string>;
export type FetchHistoryByContactIdAction = Action<string, string>;
Expand Down