Updated expenses action in redux to not call more than once
• Updated: - expenses action in redux to not call more than once
This commit is contained in:
parent
33d8f571cd
commit
f7b061845e
@ -11,6 +11,9 @@ export const EXPENSES_FETCH_FAIL = 'EXPENSES_FETCH_FAIL'
|
|||||||
export const fetchExpenses = () => (dispatch, getState) => {
|
export const fetchExpenses = () => (dispatch, getState) => {
|
||||||
if (!me) return
|
if (!me) return
|
||||||
|
|
||||||
|
const isFetched = getState().getIn(['expenses', 'fetched'], false)
|
||||||
|
if (isFetched) return
|
||||||
|
|
||||||
dispatch(fetchExpensesRequest())
|
dispatch(fetchExpensesRequest())
|
||||||
|
|
||||||
api(getState).get('/api/v1/expenses').then((response) => {
|
api(getState).get('/api/v1/expenses').then((response) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user