Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arreglo url #250

Merged
merged 1 commit into from
May 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions webapp/src/componentes/editarProducto/editarProducto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ 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.API_URL || 'http://localhost:5000'
const apiEndPoint = process.env.REACT_APP_API_URI || 'http://localhost:5000'
let partes = url.split('/');
let response = await fetch(apiEndPoint + "/juguete/" + partes[partes.length - 1]);
//The objects returned by the api are directly convertible to User objects
Expand All @@ -22,7 +21,7 @@ async function getJuguete(): Promise<Juguete> {
}

async function updateJuguete(): Promise<any> {
const apiEndPoint = process.env.API_URL || 'http://localhost:5000'
const apiEndPoint = process.env.REACT_APP_API_URI || 'http://localhost:5000'
let partes = url.split('/');
let response = await fetch(apiEndPoint + "/juguete/update/" + partes[partes.length - 1], {
method: 'POST',
Expand Down