Skip to content

Commit

Permalink
fix(interest): ts errors in redux saga
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLeoB committed May 27, 2020
1 parent a142bc8 commit 034b4cb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ export const fetchInterestInstrumentsSuccess = (
})

// LIMITS
export const fetchInterestLimits = (coin?: CoinType, currency?: FiatType) => ({
export const fetchInterestLimits = (coin: CoinType, currency: FiatType) => ({
type: AT.FETCH_INTEREST_LIMITS,
payload: { coin, currency }
coin,
currency
})
export const fetchInterestLimitsFailure = (
error: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export default ({
interestSagas.fetchInterestInstruments
)
yield takeLatest(
// @ts-ignore
AT.FETCH_INTEREST_LIMITS,
interestSagas.fetchInterestLimits
)
Expand All @@ -42,7 +41,6 @@ export default ({
)
yield takeLatest(AT.FETCH_INTEREST_RATE, interestSagas.fetchInterestRate)
yield takeLeading(
// @ts-ignore
AT.FETCH_INTEREST_TRANSACTIONS,
interestSagas.fetchInterestTransactions
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ export default ({
}
}

const fetchInterestLimits = function * ({ payload }) {
const { coin, currency } = payload
const fetchInterestLimits = function * ({
coin,
currency
}: ReturnType<typeof A.fetchInterestLimits>) {
try {
yield put(A.fetchInterestLimitsLoading())
const response: ReturnType<typeof api.getInterestLimits> = yield call(
Expand Down Expand Up @@ -125,7 +127,9 @@ export default ({
}
}

const fetchInterestTransactions = function * ({ payload }) {
const fetchInterestTransactions = function * ({
payload
}: ReturnType<typeof A.fetchInterestTransactions>) {
const { reset } = payload
try {
const nextPage = yield select(S.getTransactionsNextPage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as AT from './actionTypes'
import {
AccountTypes,
CoinType,
FiatType,
InterestAccountBalanceType,
InterestAccountType,
InterestEligibleType,
Expand Down Expand Up @@ -115,10 +114,6 @@ interface FetchInterestInstrumentsSuccess {

// LIMITS

interface FetchInterestLimits {
payload: { coin?: CoinType; currency?: FiatType }
type: typeof AT.FETCH_INTEREST_LIMITS
}
interface FetchInterestLimitsFailure {
payload: { error: string }
type: typeof AT.FETCH_INTEREST_LIMITS_FAILURE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export default ({ nabuUrl, authorizedGet, authorizedPost }) => {
})

const getInterestLimits = (
ccy?: CoinType,
currency?: FiatType
ccy: CoinType,
currency: FiatType
): { limits: InterestLimitsType } =>
authorizedGet({
url: nabuUrl,
Expand Down

0 comments on commit 034b4cb

Please sign in to comment.