Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement