mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
refactor: customers alerts.
This commit is contained in:
@@ -10,7 +10,7 @@ const initialState = {
|
||||
views: {},
|
||||
loading: false,
|
||||
currentViewId: -1,
|
||||
|
||||
selectedRows: [],
|
||||
// Responsible for data fetch query based on this query.
|
||||
tableQuery: {
|
||||
page_size: 12,
|
||||
@@ -49,7 +49,6 @@ export default createReducer(initialState, {
|
||||
state.views[viewId] = {
|
||||
...view,
|
||||
pages: {
|
||||
|
||||
...(state.views?.[viewId]?.pages || {}),
|
||||
[paginationMeta.page]: {
|
||||
ids: customers.map((i) => i.id),
|
||||
@@ -85,11 +84,14 @@ export default createReducer(initialState, {
|
||||
});
|
||||
state.items = items;
|
||||
},
|
||||
|
||||
[t.CUSTOMER_SELECTED_ROWS_SET]: (state, action) => {
|
||||
const { selectedRows } = action.payload;
|
||||
state.selectedRows = selectedRows;
|
||||
},
|
||||
...viewPaginationSetReducer(t.CUSTOMERS_PAGINATION_SET),
|
||||
...createTableQueryReducers('CUSTOMERS'),
|
||||
});
|
||||
|
||||
export const getCustomerById = (state, id) => {
|
||||
return state.customers.items[id];
|
||||
};
|
||||
};
|
||||
@@ -8,4 +8,5 @@ export default {
|
||||
CUSTOMERS_BULK_DELETE: 'CUSTOMERS_BULK_DELETE',
|
||||
CUSTOMERS_PAGINATION_SET: 'CUSTOMERS_PAGINATION_SET',
|
||||
CUSTOMERS_SET_CURRENT_VIEW: 'CUSTOMERS_SET_CURRENT_VIEW',
|
||||
CUSTOMER_SELECTED_ROWS_SET: 'CUSTOMER_SELECTED_ROWS_SET',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user