mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-22 15:50:32 +00:00
WIP
This commit is contained in:
26
client/src/store/currencies/currencies.actions.js
Normal file
26
client/src/store/currencies/currencies.actions.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import ApiService from "services/ApiService";
|
||||
import t from 'store/types';
|
||||
|
||||
export const fetchCurrencies = () => {
|
||||
return (dispatch) => new Promise((resolve, reject) => {
|
||||
ApiService.get(`currencies/registered`).then((response) => {
|
||||
dispatch({
|
||||
type: t.CURRENCIES_REGISTERED_SET,
|
||||
currencies: response.data.currencies,
|
||||
});
|
||||
resolve(response);
|
||||
}).catch(error => { reject(error); });
|
||||
});
|
||||
};
|
||||
|
||||
export const fetchAllCurrencies = () => {
|
||||
return (dispatch) => new Promise((resolve, reject) => {
|
||||
ApiService.get(`currencies/all`).then((response) => {
|
||||
dispatch({
|
||||
type: t.CURRENCIES_ALL_SET,
|
||||
currencies: response.data.currencies,
|
||||
});
|
||||
resolve(response);
|
||||
}).catch(error => { reject(error); });
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user