Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 7349 | Rev 7371 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 7349 Rev 7367
Línea 4... Línea 4...
4
export const getPermissions = () => {
4
export const getPermissions = () => {
5
  return (dispatch) => {
5
  return (dispatch) => {
6
    axios
6
    axios
7
      .get('/signin', { headers: { 'Content-Type': 'application/json' } })
7
      .get('/signin', { headers: { 'Content-Type': 'application/json' } })
8
      .then(({ data: permissions }) => {
8
      .then(({ data: permissions }) => {
-
 
9
        dispatch(
9
        dispatch(setPermissions(permissions))
10
          setPermissions({ ...permissions, isAuth: permissions.is_logged_in })
-
 
11
        )
10
      })
12
      })
11
      .catch((err) => {
13
      .catch((err) => {
12
        console.log(err)
14
        console.log(err)
13
        throw new Error(err)
15
        throw new Error(err)
14
      })
16
      })