mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +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) => {
|
||||
ApiService.delete(`users/${id}`)
|
||||
.then((response) => {
|
||||
dispatch({ type: t.USER_DELETE, id });
|
||||
dispatch({
|
||||
type: t.USER_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
resolve(response);
|
||||
})
|
||||
.catch((error) => {
|
||||
|
||||
@@ -34,6 +34,12 @@ export default createReducer(initialState, {
|
||||
const { loading } = action.payload;
|
||||
state.loading = loading;
|
||||
},
|
||||
[t.USER_DELETE]: (state, action) => {
|
||||
const { id } = action.payload;
|
||||
if (typeof state.items[id] !== 'undefined') {
|
||||
delete state.items[id];
|
||||
}
|
||||
},
|
||||
|
||||
...createTableQueryReducers('USERS'),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user