mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -54,7 +54,12 @@ export const deleteUser = ({ id }) => {
|
|||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
ApiService.delete(`users/${id}`)
|
ApiService.delete(`users/${id}`)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
dispatch({ type: t.USER_DELETE, id });
|
dispatch({
|
||||||
|
type: t.USER_DELETE,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
},
|
||||||
|
});
|
||||||
resolve(response);
|
resolve(response);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|||||||
@@ -34,6 +34,12 @@ export default createReducer(initialState, {
|
|||||||
const { loading } = action.payload;
|
const { loading } = action.payload;
|
||||||
state.loading = loading;
|
state.loading = loading;
|
||||||
},
|
},
|
||||||
|
[t.USER_DELETE]: (state, action) => {
|
||||||
|
const { id } = action.payload;
|
||||||
|
if (typeof state.items[id] !== 'undefined') {
|
||||||
|
delete state.items[id];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
...createTableQueryReducers('USERS'),
|
...createTableQueryReducers('USERS'),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user