Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 6499 | Rev 6501 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
6493 stevensc 1
import { actionsTypes } from './auth.types'
2
 
3
const initialState = {
6495 stevensc 4
  permissions: '',
6493 stevensc 5
}
6
 
6496 stevensc 7
const AuthReducer = (state = initialState, { type, payload }) => {
6499 stevensc 8
  console.log('Auth reducer')
9
 
10
  const actionCases = {
11
    [actionsTypes.SET_PERMISSIONS]: { ...state, permissions: payload },
6493 stevensc 12
  }
6499 stevensc 13
 
6500 stevensc 14
  return actionCases[type] || state
6493 stevensc 15
}
6496 stevensc 16
 
17
export default AuthReducer