Files
bigcapital/client/src/store/settings/settings.actions.js
Ahmed Bouhuolia 1bc719dea7 fix: auto-increment journal number.
WIP: customer form.
2020-11-08 16:24:13 +02:00

32 lines
737 B
JavaScript

import ApiService from 'services/ApiService';
import t from 'store/types';
export const submitOptions = ({ form }) => {
return (dispatch) => {
return ApiService.post('settings', form).then((response) => {
dispatch({
type: t.SETTING_SET,
options: form.options,
});
return response;
});
};
};
export const FetchOptions = ({ form }) => {
return (dispatch) =>
new Promise((resolve, reject) => {
ApiService.get('settings')
.then((response) => {
dispatch({
type: t.SETTING_SET,
options: response.data.settings,
});
resolve(response);
})
.catch((error) => {
reject(error);
});
});
};