|
@ -67,9 +67,8 @@ export const fetchAccounts: FetchAccounts = () => (dispatch, getState) => { |
|
|
export type UpdateAccountWithUpdater = (accountId: string, (Account) => Account) => * |
|
|
export type UpdateAccountWithUpdater = (accountId: string, (Account) => Account) => * |
|
|
|
|
|
|
|
|
export const updateAccountWithUpdater: UpdateAccountWithUpdater = (accountId, updater) => ({ |
|
|
export const updateAccountWithUpdater: UpdateAccountWithUpdater = (accountId, updater) => ({ |
|
|
type: 'UPDATE_ACCOUNT', |
|
|
type: 'DB:UPDATE_ACCOUNT', |
|
|
accountId, |
|
|
payload: { accountId, updater }, |
|
|
updater, |
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
export type UpdateAccount = ($Shape<Account>) => (Function, Function) => void |
|
|
export type UpdateAccount = ($Shape<Account>) => (Function, Function) => void |
|
@ -78,9 +77,11 @@ export const updateAccount: UpdateAccount = payload => (dispatch, getState) => { |
|
|
settings: { orderAccounts }, |
|
|
settings: { orderAccounts }, |
|
|
} = getState() |
|
|
} = getState() |
|
|
dispatch({ |
|
|
dispatch({ |
|
|
type: 'UPDATE_ACCOUNT', |
|
|
type: 'DB:UPDATE_ACCOUNT', |
|
|
updater: account => ({ ...account, ...payload }), |
|
|
payload: { |
|
|
accountId: payload.id, |
|
|
updater: account => ({ ...account, ...payload }), |
|
|
|
|
|
accountId: payload.id, |
|
|
|
|
|
}, |
|
|
}) |
|
|
}) |
|
|
dispatch(updateOrderAccounts(orderAccounts)) |
|
|
dispatch(updateOrderAccounts(orderAccounts)) |
|
|
// TODO should not be here IMO.. feels wrong for perf, probably better to move in reducer too
|
|
|
// TODO should not be here IMO.. feels wrong for perf, probably better to move in reducer too
|
|
|