From aca60535943e4df870c0ff52b0720bf2d689eedf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mu=C3=B1iz?= Date: Tue, 3 May 2022 12:49:46 +0200 Subject: [PATCH] Probar varaible entorno --- .../src/componentes/editarProducto/editarProducto.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webapp/src/componentes/editarProducto/editarProducto.tsx b/webapp/src/componentes/editarProducto/editarProducto.tsx index 84ab333..e4381a2 100644 --- a/webapp/src/componentes/editarProducto/editarProducto.tsx +++ b/webapp/src/componentes/editarProducto/editarProducto.tsx @@ -12,10 +12,9 @@ var categoria: string; var precio: number; async function getJuguete(): Promise { - const apiEndPoint = process.env.REACT_APP_API_URI || 'http://localhost:5000/' - //const apiEndPoint= process.env.REACT_APP_API_URI || 'https://dede-en2a-restapi.herokuapp.com' + //const apiEndPoint = process.env.REACT_APP_API_URI || 'http://localhost:5000/' + const apiEndPoint = process.env.API_URL || 'http://localhost:5000/' let partes = url.split('/'); - //console.log(partes[partes.length - 1]); let response = await fetch(apiEndPoint + "juguete/" + partes[partes.length - 1]); //The objects returned by the api are directly convertible to User objects let j = response.json(); @@ -24,8 +23,9 @@ async function getJuguete(): Promise { } async function updateJuguete(): Promise { - const apiEndPoint = process.env.REACT_APP_API_URI || 'http://localhost:5000/' - //const apiEndPoint= process.env.REACT_APP_API_URI || 'https://dede-en2a-restapi.herokuapp.com' + const apiEndPoint = process.env.API_URL || 'http://localhost:5000/' + //console.log(process.env.REACT_APP_API_URI) + //const apiEndPoint = process.env.REACT_APP_API_URI || 'https://dede-es2a-restapi.herokuapp.com/' let partes = url.split('/'); let response = await fetch(apiEndPoint + "juguete/update/" + partes[partes.length - 1], { method: 'POST',