Merge remote-tracking branch 'origin/master'

This commit is contained in:
Ahmed Bouhuolia
2020-11-07 22:02:21 +02:00
6 changed files with 34 additions and 25 deletions

View File

@@ -111,21 +111,21 @@ export const fetchPaymentReceivesTable = ({ query = {} }) => {
dispatch({
type: t.PAYMENT_RECEIVES_PAGE_SET,
payload: {
payment_receives: response.data.payment_receives.results,
pagination: response.data.payment_receives.pagination,
payment_receives: response.data.payment_receives,
pagination: response.data.pagination,
customViewId: response.data.customViewId || -1,
},
});
dispatch({
type: t.PAYMENT_RECEIVES_ITEMS_SET,
payload: {
payment_receives: response.data.payment_receives.results,
payment_receives: response.data.payment_receives,
},
});
dispatch({
type: t.PAYMENT_RECEIVES_PAGINATION_SET,
payload: {
pagination: response.data.payment_receives.pagination,
pagination: response.data.pagination,
customViewId: response.data.customViewId || -1,
},
});

View File

@@ -71,9 +71,8 @@ const reducer = createReducer(initialState, {
[t.PAYMENT_RECEIVES_PAGINATION_SET]: (state, action) => {
const { pagination, customViewId } = action.payload;
const mapped = {
pageSize: parseInt(pagination.pageSize, 10),
pageSize: parseInt(pagination.page_size, 10),
page: parseInt(pagination.page, 10),
total: parseInt(pagination.total, 10),
};
@@ -96,7 +95,6 @@ const reducer = createReducer(initialState, {
const viewId = customViewId || -1;
const view = state.views[viewId] || {};
state.views[viewId] = {
...view,
pages: {