hide bitacora
This commit is contained in:
@@ -29,18 +29,15 @@ export default function AddTime({
|
||||
}: AddTimeProps) {
|
||||
const router = useRouter();
|
||||
|
||||
// 🔹 selección plataforma
|
||||
const [plataformaSeleccionada, setPlataformaSeleccionada] = useState<
|
||||
string | null
|
||||
>(null);
|
||||
|
||||
// 🔹 datos del recibo
|
||||
const [folio, setFolio] = useState("");
|
||||
const [amount, setAmount] = useState("");
|
||||
const todayISO = new Date().toISOString().split("T")[0];
|
||||
const [date, setDate] = useState(todayISO);
|
||||
|
||||
// 🔹 restricción de fechas
|
||||
const day = new Date();
|
||||
const year = day.getFullYear();
|
||||
const month = day.getMonth();
|
||||
@@ -49,7 +46,6 @@ export default function AddTime({
|
||||
const minFecha = new Date(year, month, 1).toISOString().split("T")[0];
|
||||
const maxFecha = new Date(year, month, today).toISOString().split("T")[0];
|
||||
|
||||
// 🔹 lógica central (AQUÍ crecerá después)
|
||||
const handleSaveReceipt = async () => {
|
||||
if (!numAcount) {
|
||||
toast.error("Busca de nuevo al estudiante");
|
||||
@@ -177,3 +173,4 @@ export default function AddTime({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
//IO
|
||||
@@ -4,9 +4,10 @@ import { useEffect, useState } from "react";
|
||||
import { envConfig } from "@/app/lib/config";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
import "./asignacion.css";
|
||||
import { getEquipoByCount } from "@/app/lib/getEquipoByCount";
|
||||
|
||||
import "./asignacion.css";
|
||||
|
||||
type Props = {
|
||||
inscripcion: any[];
|
||||
numAcount: number;
|
||||
@@ -19,13 +20,12 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) {
|
||||
const [equipoSeleccionado, setEquipoSeleccionado] = useState<any>(null);
|
||||
const [open, setOpen] = useState(false);
|
||||
const [tiempo, setTiempo] = useState<number>(15);
|
||||
const [bitacora, setBitacora] = useState(null);
|
||||
const [bitacora, setBitacora] = useState<[]|null>(null);
|
||||
|
||||
const fetchByCuenta = async (idCuenta: number) => {
|
||||
const result = await getEquipoByCount(idCuenta);
|
||||
|
||||
if (result?.error) {
|
||||
toast.error(result.error);
|
||||
setBitacora(null);
|
||||
} else {
|
||||
setBitacora(result);
|
||||
@@ -117,6 +117,7 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) {
|
||||
throw new Error("Error al asignar equipo");
|
||||
}
|
||||
|
||||
setBitacora([])
|
||||
toast.success("Equipo asignado correctamente");
|
||||
} catch (error) {
|
||||
toast.error("No se pudo asignar el equipo");
|
||||
@@ -124,9 +125,8 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) {
|
||||
};
|
||||
|
||||
if (bitacora) {
|
||||
return (<></>
|
||||
);
|
||||
}
|
||||
return <></>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="containerForm">
|
||||
|
||||
Reference in New Issue
Block a user