Created
July 4, 2019 21:03
-
-
Save juniorUsca/cade0815135f20c03c2158bfd54f3482 to your computer and use it in GitHub Desktop.
Fetch evaluaciones
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const baseUrl = gcUrlBase.slice(0, -1) | |
const options = { | |
// descomentar para POST | |
// method: 'POST', | |
// body: JSON.stringify(data), | |
headers: { | |
'Content-Type': 'application/json', | |
AppRRHH: Cookies.get('AppRRHH'), | |
}, | |
} | |
getEvaluacionesPlantillas = async () => { | |
try { | |
const response = await fetch(`${baseUrl}/listarPlantillaEvaluacion`, options); | |
if (!response.ok) throw Error(response.statusText); | |
const data = await response.json(); if (data.nCodError > 1) throw Error(data.cMsjError); | |
return data.oContenido; | |
} catch (error) { console.log(error) } | |
return [] | |
}, | |
async miFuncion() { | |
const datos = await getEvaluacionesPlantillas() | |
console.log(datos) | |
} | |
miFuncion() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment