Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2203 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 2203 Rev 3719
Línea 1... Línea 1...
1
import { axios } from '@app/utils'
1
import { axios } from '@app/utils';
2
 
2
 
3
export const checkSession = async (url) => {
3
export const checkSession = async (url) => {
4
  const response = await axios.get(url)
4
  const response = await axios.get(url);
5
  const { data, success } = response.data
5
  const { data, success } = response.data;
6
 
6
 
7
  if (!success) {
7
  if (!success) {
8
    throw new Error(
-
 
9
      'Error al obtener las notificaciones, por favor intente más tarde'
8
    throw new Error('Error al obtener las notificaciones, por favor intente más tarde');
10
    )
-
 
11
  }
9
  }
12
 
10
 
13
  return {
11
  return {
14
    messages: parseInt(data.total_messages),
12
    messages: parseInt(data.total_messages),
15
    notifications: parseInt(data.total_notifications)
13
    notifications: parseInt(data.total_notifications)
16
  }
14
  };
17
}
15
};