mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
Fix: Exchange Rate Pageination
This commit is contained in:
@@ -4,26 +4,40 @@ import t from 'store/types';
|
||||
export const fetchExchangeRates = () => {
|
||||
return (dispatch) =>
|
||||
new Promise((resolve, reject) => {
|
||||
dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_LOADING,
|
||||
});
|
||||
dispatch({
|
||||
type: t.EXCHANGE_RATE_TABLE_LOADING,
|
||||
loading: true,
|
||||
payload: {
|
||||
loading: true,
|
||||
},
|
||||
});
|
||||
|
||||
ApiService.get('exchange_rates')
|
||||
.then((response) => {
|
||||
|
||||
dispatch({
|
||||
type: t.EXCHANGE_RATES_PAGE_SET,
|
||||
payload: {
|
||||
exchange_rates: response.data.exchange_rates.results,
|
||||
pagination: response.data.exchange_rates.pagination,
|
||||
customViewId: response.data.exchange_rates.customViewId || -1,
|
||||
},
|
||||
});
|
||||
dispatch({
|
||||
type: t.EXCHANGE_RATE_LIST_SET,
|
||||
exchange_rates: response.data.exchange_rates.results,
|
||||
});
|
||||
|
||||
dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_COMPLETED,
|
||||
type: t.EXCHANGE_RATES_PAGINATION_SET,
|
||||
payload: {
|
||||
pagination: response.data.exchange_rates.pagination,
|
||||
customViewId: response.data.customViewId || -1,
|
||||
},
|
||||
});
|
||||
dispatch({
|
||||
type: t.EXCHANGE_RATE_TABLE_LOADING,
|
||||
loading: false,
|
||||
payload: {
|
||||
loading: false,
|
||||
},
|
||||
});
|
||||
resolve(response);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user