Rev 6513 | Rev 7350 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import { actionsTypes } from './auth.types'const initialState = {access_usign_social_networks: 'y',aes: '',defaultNetwork: 'y',email: '',favico_url: '',intro: '',logo_url: '',navbar_url: '',remember: true,site_key: '',isAuth: false,theme_id: '1',}const AuthReducer = (state = initialState, action) => {const { type, payload } = actionconst actionCases = {[actionsTypes.SET_PERMISSIONS]: { ...state, ...payload },[actionsTypes.LOGIN]: { ...state, isAuth: true },[actionsTypes.LOGOUT]: { ...state, isAuth: false },}return actionCases[type] || state}export default AuthReducer