mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
fix: seed view roles relations. fix: stopped all resources reducers temp. fix: stopped filter dropdown component temp.
49 lines
1.5 KiB
JavaScript
49 lines
1.5 KiB
JavaScript
import ApiService from "services/ApiService";
|
|
import t from 'store/types';
|
|
|
|
export const fetchResourceColumns = ({ resourceSlug }) => {
|
|
return (dispatch) => new Promise((resolve, reject) => {
|
|
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); });
|
|
});
|
|
};
|
|
|
|
export const fetchResourceFields = ({ resourceSlug }) => {
|
|
return (dispatch) => new Promise((resolve, reject) => {
|
|
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); });
|
|
});
|
|
};
|
|
|
|
export const fetchResourceData = ({ resourceSlug }) => {
|
|
return (dispatch) => new Promise((resolve, reject) => {
|
|
ApiService.get(`/resources/${resourceSlug}/data`).then((response) => {
|
|
// dispatch({
|
|
// type: t.RESOURCE_DATA_SET,
|
|
// payload: {
|
|
// data: response.data.data,
|
|
// resource_key: resourceSlug,
|
|
// },
|
|
// });
|
|
resolve(response);
|
|
}).catch(error => { reject(error); });
|
|
});
|
|
}; |