mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
26 lines
596 B
JavaScript
26 lines
596 B
JavaScript
import ApiService from 'services/ApiService';
|
|
import t from 'store/types';
|
|
|
|
export const submitOptions = ({ form }) => {
|
|
return (dispatch) => {
|
|
return ApiService.post('options', form);
|
|
};
|
|
};
|
|
|
|
export const FetchOptions = ({ form }) => {
|
|
return (dispatch) =>
|
|
new Promise((resolve, reject) => {
|
|
ApiService.get('options')
|
|
.then((response) => {
|
|
dispatch({
|
|
type: t.SETTING_SET,
|
|
options: response.data.options,
|
|
});
|
|
resolve(response);
|
|
})
|
|
.catch((error) => {
|
|
reject(error);
|
|
});
|
|
});
|
|
};
|