diff --git a/app/(private)/InformacionEquipo/InformacionEquipo.tsx b/app/(private)/InformacionEquipo/InformacionEquipo.tsx index e6c3bd0..eeec31c 100644 --- a/app/(private)/InformacionEquipo/InformacionEquipo.tsx +++ b/app/(private)/InformacionEquipo/InformacionEquipo.tsx @@ -16,7 +16,7 @@ export default function InformacionEquipo({ defaultKey?: string; }) { const [id, setId] = useState(null); - const [ubicacion, setUbicacion] = useState(null); + const [ubicacion, setUbicacion] = useState(null); return (
diff --git a/app/Components/InformacionEquipos/ProgramSelector.tsx b/app/Components/InformacionEquipos/ProgramSelector.tsx index 9582c5e..86c5292 100644 --- a/app/Components/InformacionEquipos/ProgramSelector.tsx +++ b/app/Components/InformacionEquipos/ProgramSelector.tsx @@ -14,7 +14,7 @@ export default function ProgramSelector({ ubicacion, id, }: { - ubicacion?: string | null; + ubicacion?: number | null; id?: number | null; }) { const [programas, setProgramas] = useState([]); @@ -56,7 +56,7 @@ export default function ProgramSelector({ .map(Number); try { - if (ubicacion && ubicacion !== "0") { + if (ubicacion) { await axios.patch( `${envConfig.apiUrl}/programa-equipo/equipo/${ubicacion}`, { @@ -121,7 +121,7 @@ export default function ProgramSelector({ try { let res; - if (ubicacion && ubicacion !== "0") { + if (ubicacion) { res = await axios.get( `${envConfig.apiUrl}/programa-equipo/${ubicacion}`, { headers }, diff --git a/app/Components/InformacionEquipos/SelectorEquipo.tsx b/app/Components/InformacionEquipos/SelectorEquipo.tsx index c669128..1ff7757 100644 --- a/app/Components/InformacionEquipos/SelectorEquipo.tsx +++ b/app/Components/InformacionEquipos/SelectorEquipo.tsx @@ -21,7 +21,7 @@ interface Equipos { } interface Props { - onSearch: (ubicacion: string) => void; + onSearch: (id_equipo: number) => void; } export default function SelectorEquipo({ onSearch }: Props) { @@ -57,7 +57,7 @@ export default function SelectorEquipo({ onSearch }: Props) { const eq = equipos.find(e => e.id_equipo === paramEquipo); if (eq) { setSelected(eq); - onSearch(eq.ubicacion); + onSearch(eq.id_equipo); } } }, [paramEquipo, equipos]);