Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. const baseUrl = gcUrlBase.slice(0, -1)
  2. const options = {
  3. // descomentar para POST
  4. // method: 'POST',
  5. // body: JSON.stringify(data),
  6. headers: {
  7. 'Content-Type': 'application/json',
  8. AppRRHH: Cookies.get('AppRRHH'),
  9. },
  10. }
  11.  
  12. getEvaluacionesPlantillas = async () => {
  13. try {
  14. const response = await fetch(`${baseUrl}/listarPlantillaEvaluacion`, options);
  15. if (!response.ok) throw Error(response.statusText);
  16. const data = await response.json(); if (data.nCodError > 1) throw Error(data.cMsjError);
  17. return data.oContenido;
  18. } catch (error) { console.log(error) }
  19. return []
  20. },
  21.  
  22. async miFuncion() {
  23. const datos = await getEvaluacionesPlantillas()
  24. console.log(datos)
  25. }
  26.  
  27. miFuncion()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement