mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
fix bugs.
This commit is contained in:
@@ -3,12 +3,18 @@ import t from 'store/types';
|
||||
|
||||
export const fetchResourceColumns = ({ resourceSlug }) => {
|
||||
return (dispatch) => new Promise((resolve, reject) => {
|
||||
dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_LOADING,
|
||||
});
|
||||
ApiService.get(`resources/${resourceSlug}/columns`).then((response) => {
|
||||
dispatch({
|
||||
type: t.RESOURCE_COLUMNS_SET,
|
||||
columns: response.data.resource_columns,
|
||||
resource_slug: resourceSlug,
|
||||
});
|
||||
dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_COMPLETED,
|
||||
});
|
||||
resolve(response);
|
||||
}).catch((error) => { reject(error); });
|
||||
});
|
||||
@@ -16,12 +22,18 @@ export const fetchResourceColumns = ({ resourceSlug }) => {
|
||||
|
||||
export const fetchResourceFields = ({ resourceSlug }) => {
|
||||
return (dispatch) => new Promise((resolve, reject) => {
|
||||
dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_LOADING,
|
||||
});
|
||||
ApiService.get(`resources/${resourceSlug}/fields`).then((response) => {
|
||||
dispatch({
|
||||
type: t.RESOURCE_FIELDS_SET,
|
||||
fields: response.data.resource_fields,
|
||||
resource_slug: resourceSlug,
|
||||
});
|
||||
dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_COMPLETED,
|
||||
});
|
||||
resolve(response);
|
||||
}).catch((error) => { reject(error); });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user