diff --git a/app/reducers/permissions.js b/app/reducers/permissions.js index dbba0e1077..034c514208 100644 --- a/app/reducers/permissions.js +++ b/app/reducers/permissions.js @@ -1,8 +1,6 @@ import { PERMISSIONS } from '../actions/actionsTypes'; -const initialState = { - permissions: {} -}; +const initialState = {}; export default function permissions(state = initialState, action) { switch (action.type) { diff --git a/app/reducers/roles.js b/app/reducers/roles.js index 3ce0943e85..0a3ade1af8 100644 --- a/app/reducers/roles.js +++ b/app/reducers/roles.js @@ -1,8 +1,6 @@ import { ROLES } from '../actions/actionsTypes'; -const initialState = { - roles: {} -}; +const initialState = {}; export default function permissions(state = initialState, action) { switch (action.type) { @@ -14,7 +12,8 @@ export default function permissions(state = initialState, action) { [action.payload.id]: action.payload.desc || action.payload.id }; case ROLES.REMOVE: - return state.filter(role => role.id !== action.payload.id); + const { [action.payload.id]: roleRemoved, ...newState } = state; + return newState; default: return state; }