mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
wip
This commit is contained in:
@@ -2,26 +2,31 @@
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { isEqual } from 'lodash';
|
||||
|
||||
import {
|
||||
paginationLocationQuery,
|
||||
} from '@/store/selectors';
|
||||
import { paginationLocationQuery } from '@/store/selectors';
|
||||
import { createDeepEqualSelector } from '@/utils';
|
||||
import { defaultTableQuery } from './paymentReceives.reducer';
|
||||
|
||||
const paymentReceiveTableState = (state) => state.paymentReceives.tableState;
|
||||
|
||||
// Retrieve payment receives table fetch query.
|
||||
export const getPaymentReceiveTableStateFactory = () => createSelector(
|
||||
paginationLocationQuery,
|
||||
paymentReceiveTableState,
|
||||
(locationQuery, tableState) => {
|
||||
return {
|
||||
...locationQuery,
|
||||
...tableState,
|
||||
};
|
||||
},
|
||||
);
|
||||
export const getPaymentReceiveTableStateFactory = () =>
|
||||
createSelector(
|
||||
paginationLocationQuery,
|
||||
paymentReceiveTableState,
|
||||
(locationQuery, tableState) => {
|
||||
return {
|
||||
...locationQuery,
|
||||
...tableState,
|
||||
};
|
||||
},
|
||||
);
|
||||
export const paymentsTableStateChangedFactory = () =>
|
||||
createDeepEqualSelector(paymentReceiveTableState, (tableState) => {
|
||||
return !isEqual(tableState, defaultTableQuery);
|
||||
});
|
||||
|
||||
export const getPaymentReceivesSelectedRowsFactory = () =>
|
||||
createSelector(
|
||||
(state) => state.paymentReceives.selectedRows,
|
||||
(selectedRows) => selectedRows,
|
||||
);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// @ts-nocheck
|
||||
import { isEqual } from 'lodash';
|
||||
import { createSelector } from 'reselect';
|
||||
import { paginationLocationQuery } from '@/store/selectors';
|
||||
import { createDeepEqualSelector } from '@/utils';
|
||||
import { defaultTableQuery } from './VendorCredit.reducer';
|
||||
|
||||
@@ -12,4 +12,11 @@ export const resetReceiptsTableState = () => {
|
||||
return {
|
||||
type: t.RECEIPTS_TABLE_STATE_RESET,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export const setReceiptsSelectedRows = (selectedRows) => {
|
||||
return {
|
||||
type: t.RECEIPTS_SELECTED_ROWS_SET,
|
||||
payload: selectedRows,
|
||||
};
|
||||
};
|
||||
@@ -3,4 +3,5 @@
|
||||
export default {
|
||||
RECEIPTS_TABLE_STATE_SET: 'RECEIPTS/TABLE_STATE_SET',
|
||||
RECEIPTS_TABLE_STATE_RESET: 'RECEIPTS/TABLE_STATE_RESET',
|
||||
RECEIPTS_SELECTED_ROWS_SET: 'RECEIPTS/SELECTED_ROWS_SET',
|
||||
};
|
||||
Reference in New Issue
Block a user