mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
feat: Fix axios interceptors.
This commit is contained in:
12
client/src/store/globalErrors/globalErrors.actions.js
Normal file
12
client/src/store/globalErrors/globalErrors.actions.js
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
export const setGlobalErrors = (errors) => {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: 'GLOBAL_ERRORS_SET',
|
||||
payload: {
|
||||
errors,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
17
client/src/store/globalErrors/globalErrors.reducer.js
Normal file
17
client/src/store/globalErrors/globalErrors.reducer.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { createReducer } from '@reduxjs/toolkit';
|
||||
import t from 'store/types';
|
||||
|
||||
const initialState = {
|
||||
data: {},
|
||||
};
|
||||
|
||||
export default createReducer(initialState, {
|
||||
['GLOBAL_ERRORS_SET']: (state, action) => {
|
||||
const { errors } = action.payload;
|
||||
|
||||
state.data = {
|
||||
...state.data,
|
||||
...errors,
|
||||
};
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user