delete hardCode

This commit is contained in:
2026-01-21 17:30:26 -06:00
parent 9686bbdd54
commit c7f2b02ab0
3 changed files with 6 additions and 4 deletions
@@ -1,5 +1,6 @@
"use client";
import { envConfig } from "@/app/lib/config";
import { useEffect, useState } from "react";
function Equipos() {
@@ -9,7 +10,7 @@ function Equipos() {
const [mensaje, setMensaje] = useState("");
useEffect(() => {
fetch("http://localhost:5000/equipo")
fetch(`${envConfig.apiUrl}/equipo`)
.then((res) => res.json())
.then((data) => setEquipos(data))
.catch(() => setMensaje("Error al cargar equipos"));
@@ -2,6 +2,7 @@
import { useEffect, useState } from "react";
import axios from "axios";
import { envConfig } from "@/app/lib/config";
interface Mesa {
idMesa: number;
@@ -18,7 +19,7 @@ export default function MesasDisponibles() {
const obtenerMesas = async () => {
try {
const response = await axios.get("http://localhost:5000/mesa");
const response = await axios.get(`${envConfig.apiUrl}/mesa`);
setMesas(response.data);
} catch (error) {
console.error("Error al obtener mesas:", error);
+2 -2
View File
@@ -1,5 +1,6 @@
"use client";
import { envConfig } from "@/app/lib/config";
import { useEffect, useState } from "react";
export default function TableEquipos() {
@@ -8,8 +9,7 @@ export default function TableEquipos() {
useEffect(() => {
console.log("LLAMANDO API EQUIPO");
fetch("http://localhost:5000/equipo")
fetch(`${envConfig.apiUrl}/equipo`)
.then((res) => res.json())
.then((data) => {
console.log("EQUIPOS:", data);