mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
fix: customer view.
This commit is contained in:
@@ -48,7 +48,8 @@ export const fetchCustomers = ({ query }) => {
|
||||
type: t.CUSTOMERS_PAGE_SET,
|
||||
payload: {
|
||||
customers: response.data.customers,
|
||||
customViewId: response.data.customViewId || -1,
|
||||
customViewId:
|
||||
response.data?.filter_meta?.view?.custom_view_id || -1,
|
||||
paginationMeta: response.data.pagination,
|
||||
},
|
||||
});
|
||||
@@ -62,7 +63,8 @@ export const fetchCustomers = ({ query }) => {
|
||||
type: t.CUSTOMERS_PAGINATION_SET,
|
||||
payload: {
|
||||
pagination: response.data.pagination,
|
||||
customViewId: response.data.customViewId || -1,
|
||||
customViewId:
|
||||
response.data?.filter_meta?.view?.custom_view_id || -1,
|
||||
},
|
||||
});
|
||||
dispatch({
|
||||
|
||||
@@ -49,6 +49,7 @@ export default createReducer(initialState, {
|
||||
state.views[viewId] = {
|
||||
...view,
|
||||
pages: {
|
||||
|
||||
...(state.views?.[viewId]?.pages || {}),
|
||||
[paginationMeta.page]: {
|
||||
ids: customers.map((i) => i.id),
|
||||
@@ -64,6 +65,10 @@ export default createReducer(initialState, {
|
||||
}
|
||||
},
|
||||
|
||||
[t.CUSTOMERS_SET_CURRENT_VIEW]: (state, action) => {
|
||||
state.currentViewId = action.currentViewId;
|
||||
},
|
||||
|
||||
[t.CUSTOMERS_TABLE_LOADING]: (state, action) => {
|
||||
const { loading } = action.payload;
|
||||
state.loading = loading;
|
||||
|
||||
@@ -7,4 +7,5 @@ export default {
|
||||
CUSTOMER_DELETE: 'CUSTOMER_DELETE',
|
||||
CUSTOMERS_BULK_DELETE: 'CUSTOMERS_BULK_DELETE',
|
||||
CUSTOMERS_PAGINATION_SET: 'CUSTOMERS_PAGINATION_SET',
|
||||
CUSTOMERS_SET_CURRENT_VIEW: 'CUSTOMERS_SET_CURRENT_VIEW',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user