mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
fix: credit & vendor reducer.
This commit is contained in:
@@ -25,12 +25,16 @@ import withVendorsCreditNotesActions from './withVendorsCreditNotesActions';
|
||||
import withSettings from '../../../Settings/withSettings';
|
||||
import withSettingsActions from '../../../Settings/withSettingsActions';
|
||||
|
||||
import withVendorActions from './withVendorActions';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
/**
|
||||
* Vendors Credit note table actions bar.
|
||||
*/
|
||||
function VendorsCreditNoteActionsBar({
|
||||
setVendorCreditsTableState,
|
||||
|
||||
// #withVendorsCreditNotes
|
||||
vendorCreditFilterRoles,
|
||||
|
||||
@@ -56,7 +60,7 @@ function VendorsCreditNoteActionsBar({
|
||||
|
||||
// Handle view tab change.
|
||||
const handleTabChange = (view) => {
|
||||
setVendorsCreditNoteTableState({ viewSlug: view ? view.slug : null });
|
||||
setVendorCreditsTableState({ viewSlug: view ? view.slug : null });
|
||||
};
|
||||
|
||||
// Handle click a refresh credit note.
|
||||
@@ -136,6 +140,7 @@ function VendorsCreditNoteActionsBar({
|
||||
|
||||
export default compose(
|
||||
withVendorsCreditNotesActions,
|
||||
withVendorActions,
|
||||
withSettingsActions,
|
||||
withVendorsCreditNotes(({ vendorsCreditNoteTableState }) => ({
|
||||
vendorCreditFilterRoles: vendorsCreditNoteTableState.filterRoles,
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
setVendorCreditTableState,
|
||||
resetVendorCreditTableState,
|
||||
} from '../../../../store/VendorCredit/vendorCredit.actions';
|
||||
|
||||
const mapDipatchToProps = (dispatch) => ({
|
||||
setVendorCreditsTableState: (queries) =>
|
||||
dispatch(setVendorCreditTableState(queries)),
|
||||
resetVendorCreditsTableState: () => dispatch(resetVendorCreditTableState()),
|
||||
});
|
||||
|
||||
export default connect(null, mapDipatchToProps);
|
||||
@@ -1,14 +1,13 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
getVendorsCreditNoteTableStateFactory,
|
||||
isVendorsCreditNoteTableStateChangedFactory,
|
||||
} from '../../../../store/vendorsCreditNotes/vendorsCreditNotes.selector';
|
||||
getVendorCreditTableStateFactory,
|
||||
isVendorCreditTableStateChangedFactory,
|
||||
} from '../../../../store/VendorCredit/vendorCredit.selector';
|
||||
|
||||
export default (mapState) => {
|
||||
const getVendorsCreditNoteTableState =
|
||||
getVendorsCreditNoteTableStateFactory();
|
||||
const getVendorsCreditNoteTableState = getVendorCreditTableStateFactory();
|
||||
const isVendorsCreditNoteTableChanged =
|
||||
isVendorsCreditNoteTableStateChangedFactory();
|
||||
isVendorCreditTableStateChangedFactory();
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
const mapped = {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
setVendorsCreditNoteTableState,
|
||||
resetVendorsCreditNoteTableState,
|
||||
} from '../../../../store/vendorsCreditNotes/vendorsCreditNotes.actions';
|
||||
setVendorCreditTableState,
|
||||
resetVendorCreditTableState,
|
||||
} from '../../../../store/VendorCredit/vendorCredit.actions';
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setVendorsCreditNoteTableState: (state) =>
|
||||
dispatch(setVendorsCreditNoteTableState(state)),
|
||||
setVendorsCreditNoteTableState: (queries) =>
|
||||
dispatch(setVendorCreditTableState(queries)),
|
||||
resetVendorsCreditNoteTableState: () =>
|
||||
dispatch(resetVendorsCreditNoteTableState()),
|
||||
dispatch(resetVendorCreditTableState()),
|
||||
});
|
||||
|
||||
export default connect(null, mapDispatchToProps);
|
||||
|
||||
Reference in New Issue
Block a user