mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
fix: auto-increment journal number.
WIP: customer form.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
export const journalNumberReducers = (type) => ({
|
||||
export const journalNumberChangedReducer = (type) => ({
|
||||
[type]: (state, action) => {
|
||||
const { isChanged } = action.payload;
|
||||
state.journalNumberChanged = isChanged;
|
||||
|
||||
@@ -2,6 +2,7 @@ import t from 'store/types';
|
||||
import { createReducer } from '@reduxjs/toolkit';
|
||||
import { createTableQueryReducers } from 'store/queryReducers';
|
||||
import { omit } from 'lodash';
|
||||
import { journalNumberChangedReducer } from 'store/journalNumber.reducer';
|
||||
|
||||
const initialState = {
|
||||
items: {},
|
||||
@@ -15,6 +16,7 @@ const initialState = {
|
||||
paginationMeta: {
|
||||
total: 0,
|
||||
},
|
||||
journalNumberChanged: false,
|
||||
};
|
||||
|
||||
const defaultJournal = {
|
||||
@@ -115,6 +117,8 @@ const reducer = createReducer(initialState, {
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
...journalNumberChangedReducer(t.MANUAL_JOURNAL_NUMBER_CHANGED),
|
||||
});
|
||||
|
||||
export default createTableQueryReducers('manual_journals', reducer);
|
||||
|
||||
@@ -3,7 +3,13 @@ import t from 'store/types';
|
||||
|
||||
export const submitOptions = ({ form }) => {
|
||||
return (dispatch) => {
|
||||
return ApiService.post('settings', form);
|
||||
return ApiService.post('settings', form).then((response) => {
|
||||
dispatch({
|
||||
type: t.SETTING_SET,
|
||||
options: form.options,
|
||||
});
|
||||
return response;
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user