mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
optimize: style dashboard topbar.
fix: seed view roles relations. fix: stopped all resources reducers temp. fix: stopped filter dropdown component temp.
This commit is contained in:
@@ -35,9 +35,6 @@ export const fetchAccountsList = () => {
|
||||
payload: {
|
||||
accounts: response.data.accounts,
|
||||
}
|
||||
})
|
||||
dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_COMPLETED,
|
||||
});
|
||||
resolve(response);
|
||||
})
|
||||
@@ -71,7 +68,7 @@ export const fetchAccountsTable = ({ query } = {}) => {
|
||||
dispatch({
|
||||
type: t.ACCOUNTS_PAGE_SET,
|
||||
accounts: response.data.accounts,
|
||||
customViewId: response.data.customViewId,
|
||||
customViewId: response.data?.filter_meta?.view?.custom_view_id,
|
||||
});
|
||||
dispatch({
|
||||
type: t.ACCOUNTS_ITEMS_SET,
|
||||
@@ -81,15 +78,9 @@ export const fetchAccountsTable = ({ query } = {}) => {
|
||||
type: t.ACCOUNTS_TABLE_LOADING,
|
||||
loading: false,
|
||||
});
|
||||
dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_COMPLETED,
|
||||
});
|
||||
resolve(response);
|
||||
})
|
||||
.catch((error) => {
|
||||
dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_COMPLETED,
|
||||
});
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
@@ -122,9 +113,6 @@ export const submitAccount = ({ form }) => {
|
||||
dispatch({
|
||||
type: t.ACCOUNT_ERRORS_CLEAR,
|
||||
});
|
||||
dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_COMPLETED,
|
||||
});
|
||||
resolve(response);
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -140,9 +128,6 @@ export const submitAccount = ({ form }) => {
|
||||
payload: { error },
|
||||
});
|
||||
}
|
||||
dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_COMPLETED,
|
||||
});
|
||||
reject(data?.errors);
|
||||
});
|
||||
});
|
||||
@@ -157,9 +142,6 @@ export const editAccount = (id, form) => {
|
||||
ApiService.post(`accounts/${id}`, form)
|
||||
.then((response) => {
|
||||
dispatch({ type: t.CLEAR_ACCOUNT_FORM_ERRORS });
|
||||
dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_COMPLETED,
|
||||
});
|
||||
resolve(response);
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -170,9 +152,6 @@ export const editAccount = (id, form) => {
|
||||
if (error) {
|
||||
dispatch({ type: t.ACCOUNT_FORM_ERRORS, error });
|
||||
}
|
||||
dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_COMPLETED,
|
||||
});
|
||||
reject(data?.errors);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -4,14 +4,14 @@ 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,
|
||||
});
|
||||
// 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); });
|
||||
});
|
||||
@@ -20,14 +20,14 @@ export const fetchResourceColumns = ({ resourceSlug }) => {
|
||||
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,
|
||||
});
|
||||
// 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); });
|
||||
});
|
||||
@@ -36,13 +36,13 @@ export const fetchResourceFields = ({ resourceSlug }) => {
|
||||
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,
|
||||
},
|
||||
});
|
||||
// dispatch({
|
||||
// type: t.RESOURCE_DATA_SET,
|
||||
// payload: {
|
||||
// data: response.data.data,
|
||||
// resource_key: resourceSlug,
|
||||
// },
|
||||
// });
|
||||
resolve(response);
|
||||
}).catch(error => { reject(error); });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user