fixed modified machines' programs

This commit is contained in:
2026-03-20 17:50:15 -05:00
parent edd4e6f0c0
commit c4c06d9ed6
3 changed files with 6 additions and 6 deletions
@@ -16,7 +16,7 @@ export default function InformacionEquipo({
defaultKey?: string;
}) {
const [id, setId] = useState<number | null>(null);
const [ubicacion, setUbicacion] = useState<string | null>(null);
const [ubicacion, setUbicacion] = useState<number | null>(null);
return (
<section className="containerSection">
@@ -14,7 +14,7 @@ export default function ProgramSelector({
ubicacion,
id,
}: {
ubicacion?: string | null;
ubicacion?: number | null;
id?: number | null;
}) {
const [programas, setProgramas] = useState<Programa[]>([]);
@@ -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 },
@@ -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]);