vn-verdnaturachat/app/reducers/permissions.js

20 lines
384 B
JavaScript
Raw Normal View History

import { PERMISSIONS } from '../actions/actionsTypes';
const initialState = {
permissions: {}
};
export default function permissions(state = initialState, action) {
switch (action.type) {
case PERMISSIONS.SET:
return action.permissions;
case PERMISSIONS.UPDATE:
return {
...state,
[action.payload.id]: action.payload.roles
};
default:
return state;
}
}