Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1179 Rev 3719
Línea 1... Línea 1...
1
import { axios } from '../utils'
1
import { axios } from '../utils';
2
 
2
 
3
export const getBackendVars = async (url) => {
3
export const getBackendVars = async (url) => {
4
  return await axios
4
  return await axios
5
    .get(url, {
5
    .get(url, {
6
      headers: { 'Content-Type': 'application/json' }
6
      headers: { 'Content-Type': 'application/json' }
7
    })
7
    })
8
    .then(({ data }) => {
8
    .then(({ data }) => {
9
      if (data.success === false) {
9
      if (data.success === false) {
10
        throw new Error(data)
10
        throw new Error(data);
11
      }
11
      }
12
 
12
 
13
      return data.data ?? data
13
      return data.data ?? data;
14
    })
14
    });
15
}
15
};