Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 803 Rev 1179
Línea 4... Línea 4...
4
 
4
 
5
export const setBaseURL = (baseURL = '') => {
5
export const setBaseURL = (baseURL = '') => {
6
  request.setBaseURL(baseURL)
6
  request.setBaseURL(baseURL)
Línea 7... Línea 7...
7
}
7
}
8
 
8
 
9
export async function getData(url) {
9
export async function getData(url, params = {}) {
10
  try {
-
 
11
    const response = await request.get(url)
10
  try {
12
    return response
11
    return await request.get(url, params)
13
  } catch (error) {
12
  } catch (error) {
14
    throw new Error(error)
13
    throw new Error(error)
Línea 15... Línea 14...
15
  }
14
  }
16
}
15
}
17
 
16
 
18
export async function sendData(url, data) {
-
 
19
  try {
17
export async function sendData(url, data, params = {}) {
20
    const response = await request.post(url, data)
18
  try {
21
    return response
19
    return await request.post(url, data, params)
22
  } catch (error) {
20
  } catch (error) {
Línea 23... Línea 21...
23
    throw new Error(error)
21
    throw new Error(error)
24
  }
22
  }
25
}
23
}
26
 
-
 
27
export async function updateData(url, data) {
24
 
28
  try {
25
export async function updateData(url, data, params = {}) {
29
    const response = await request.put(url, data)
26
  try {
30
    return response
27
    return await request.put(url, data, params)
Línea 31... Línea 28...
31
  } catch (error) {
28
  } catch (error) {
32
    throw new Error(error)
29
    throw new Error(error)
33
  }
30
  }
34
}
-
 
35
 
31
}
36
export async function deleteData(url) {
32
 
37
  try {
33
export async function deleteData(url, params = {}) {
38
    const response = await request.delete(url)
34
  try {