Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 7346 Rev 7349
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
        if (permissions.is_logged_in) {
-
 
10
          dispatch(login())
-
 
11
        } else {
-
 
12
          dispatch(logout())
-
 
13
        }
-
 
14
 
-
 
15
        dispatch(setPermissions(permissions))
9
        dispatch(setPermissions(permissions))
16
      })
10
      })
17
      .catch((err) => {
11
      .catch((err) => {
18
        console.log(err)
12
        console.log(err)
19
        throw new Error(err)
13
        throw new Error(err)