Skip to content

Commit

Permalink
Probar varaible entorno
Browse files Browse the repository at this point in the history
  • Loading branch information
UO271728 committed May 3, 2022
1 parent 77e76a7 commit aca6053
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions webapp/src/componentes/editarProducto/editarProducto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ var categoria: string;
var precio: number;

async function getJuguete(): Promise<Juguete> {
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();
Expand All @@ -24,8 +23,9 @@ async function getJuguete(): Promise<Juguete> {
}

async function updateJuguete(): Promise<any> {
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',
Expand Down

0 comments on commit aca6053

Please sign in to comment.