Merge branch 'Carlos' of repositorio.acatlan.unam.mx:IO/front-AT into Develop
This commit is contained in:
@@ -48,27 +48,52 @@ export default function AddTime({
|
||||
|
||||
const handleSaveReceipt = async () => {
|
||||
if (!numAcount) {
|
||||
toast.error("Busca de nuevo al estudiante");
|
||||
|
||||
Swal.fire({
|
||||
title: "Busca de nuevo al estudiante!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!plataformaSeleccionada) {
|
||||
toast.error("Selecciona una plataforma");
|
||||
|
||||
Swal.fire({
|
||||
title: "Selecciona una plataforma!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!folio) {
|
||||
toast.error("Ingresa el folio del ticket");
|
||||
|
||||
Swal.fire({
|
||||
title: "Ingresa el folio del ticket!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!amount) {
|
||||
toast.error("Coloca el monto a depositar");
|
||||
|
||||
Swal.fire({
|
||||
title: "Coloca el monto a depositar!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!date) {
|
||||
toast.error("Coloca la fecha");
|
||||
|
||||
Swal.fire({
|
||||
title: "Coloca la fecha!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -90,9 +115,9 @@ export default function AddTime({
|
||||
{ headers },
|
||||
);
|
||||
|
||||
toast.success("Tiempo Guardado");
|
||||
|
||||
Swal.fire({
|
||||
title: "Tiempo Guardado!",
|
||||
title: "Tiempo Guardado Correctamente!",
|
||||
icon: "success",
|
||||
draggable: true,
|
||||
});
|
||||
@@ -152,21 +177,20 @@ export default function AddTime({
|
||||
const numericValue = parseFloat(value);
|
||||
|
||||
if (lock && numericValue > 1000) {
|
||||
toast.error("El monto no puede superar $1000.00");
|
||||
|
||||
Swal.fire({
|
||||
title: "El monto no puede superar $1000.00 Desbloquea el candado !",
|
||||
title:
|
||||
"El monto no puede superar $1000.00 Desbloquea el candado !",
|
||||
icon: "error",
|
||||
draggable: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (numericValue > 10000) {
|
||||
toast.error("El monto no puede superar $10000.00");
|
||||
|
||||
Swal.fire({
|
||||
title:
|
||||
"El monto no puede superar $10000.00 pesos",
|
||||
title: "El monto no puede superar $10000.00 pesos",
|
||||
icon: "error",
|
||||
draggable: true,
|
||||
});
|
||||
|
||||
@@ -56,7 +56,12 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) {
|
||||
);
|
||||
|
||||
if (!todasAsistieron) {
|
||||
toast.error("El alumno no asistió a todas las pláticas");
|
||||
|
||||
Swal.fire({
|
||||
title: "El alumno no asistió a todas las pláticas!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
setPuedeContinuar(false);
|
||||
return;
|
||||
}
|
||||
@@ -80,12 +85,18 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) {
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error("No se pudieron cargar los equipos");
|
||||
|
||||
}
|
||||
|
||||
const data = await res.json();
|
||||
setEquipos(data);
|
||||
} catch (error) {
|
||||
toast.error("Error al cargar equipos disponibles");
|
||||
|
||||
Swal.fire({
|
||||
title: "Error al cargar equipos disponibles!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
} finally {
|
||||
setLoadingEquipos(false);
|
||||
}
|
||||
@@ -100,7 +111,12 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) {
|
||||
e.preventDefault();
|
||||
|
||||
if (!equipoSeleccionado) {
|
||||
toast.error("Selecciona un equipo");
|
||||
|
||||
Swal.fire({
|
||||
title: "Selecciona un equipo!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -125,14 +141,19 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) {
|
||||
}
|
||||
|
||||
setBitacora([])
|
||||
toast.success("Equipo asignado correctamente");
|
||||
|
||||
Swal.fire({
|
||||
title: "Equipo asignado correctamente!",
|
||||
icon: "success",
|
||||
draggable: true,
|
||||
});
|
||||
} catch (error) {
|
||||
toast.error("No se pudo asignar el equipo");
|
||||
|
||||
Swal.fire({
|
||||
title: "No se pudo asignar el equipo!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -221,4 +242,3 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
//IO
|
||||
@@ -5,6 +5,7 @@ import "@/app/globals.css";
|
||||
import axios from "axios";
|
||||
import { envConfig } from "@/app/lib/config";
|
||||
import toast from "react-hot-toast";
|
||||
import Swal from "sweetalert2";
|
||||
|
||||
export default function Areas() {
|
||||
const [areas, setAreas] = useState([]);
|
||||
@@ -29,12 +30,22 @@ export default function Areas() {
|
||||
e.preventDefault();
|
||||
|
||||
if (!selectedArea) {
|
||||
toast.error("Selecciona un área antes de actualizar");
|
||||
|
||||
Swal.fire({
|
||||
title: "Selecciona un área antes de actualizar!",
|
||||
icon: "error",
|
||||
draggable: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!modo) {
|
||||
toast.error("Selecciona un modo");
|
||||
|
||||
Swal.fire({
|
||||
title: "Selecciona un modo!",
|
||||
icon: "error",
|
||||
draggable: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -47,10 +58,20 @@ export default function Areas() {
|
||||
}
|
||||
);
|
||||
|
||||
toast.success("Equipos actualizados correctamente");
|
||||
|
||||
Swal.fire({
|
||||
title: "Equipos actualizados correctamente!",
|
||||
icon: "success",
|
||||
draggable: true,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
toast.error("Error al actualizar los equipos");
|
||||
|
||||
Swal.fire({
|
||||
title: "Error al actualizar los equipos!",
|
||||
icon: "error",
|
||||
draggable: true,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -111,4 +132,3 @@ export default function Areas() {
|
||||
</form>
|
||||
);
|
||||
}
|
||||
//IO
|
||||
@@ -5,6 +5,7 @@ import apiClient from "@/app/lib/apiClient";
|
||||
import "./registerAlta.css";
|
||||
import toast from "react-hot-toast";
|
||||
import { useRouter } from "next/navigation";
|
||||
import Swal from "sweetalert2";
|
||||
|
||||
type Carrera = {
|
||||
id_carrera: number;
|
||||
@@ -72,10 +73,22 @@ export default function RegisterAlta(props: urlProp) {
|
||||
await apiClient.post("/student", payload);
|
||||
|
||||
setSaved(true);
|
||||
toast.success("Alumno registrado correctamente");
|
||||
|
||||
Swal.fire({
|
||||
title: "Alumno registrado correctamente!",
|
||||
icon: "success",
|
||||
draggable: true,
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
console.error("Error al guardar alumno:", error);
|
||||
toast.error("Error al guardar alumno");
|
||||
|
||||
Swal.fire({
|
||||
title: "Error al guardar alumno:!",
|
||||
icon: "error",
|
||||
draggable: true,
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -31,13 +31,13 @@ export default function AsignacionMesas({ idCuenta, inscripcion }: Props) {
|
||||
setBitacora(null);
|
||||
} else {
|
||||
setBitacora([]);
|
||||
if (!result?.error) toast.error("Ya cuentas con un equipo asignado");
|
||||
if (!result?.error)
|
||||
Swal.fire({
|
||||
title: "Ya cuentas con un equipo asignado!",
|
||||
icon: "error",
|
||||
draggable: true,
|
||||
});
|
||||
if (!resultMesa?.error) toast.error("Ya cuentas con una mesa asignada");
|
||||
if (!resultMesa?.error)
|
||||
Swal.fire({
|
||||
title: "Ya cuentas con mesa asignada!",
|
||||
icon: "error",
|
||||
@@ -62,7 +62,13 @@ export default function AsignacionMesas({ idCuenta, inscripcion }: Props) {
|
||||
);
|
||||
|
||||
if (!todasAsistieron) {
|
||||
toast.error("El alumno no asistió a todas las pláticas");
|
||||
|
||||
Swal.fire({
|
||||
title: "El alumno no asistió a todas las pláticas!",
|
||||
icon: "error",
|
||||
draggable: true,
|
||||
});
|
||||
|
||||
setPuedeContinuar(false);
|
||||
return;
|
||||
}
|
||||
@@ -87,7 +93,12 @@ export default function AsignacionMesas({ idCuenta, inscripcion }: Props) {
|
||||
const data = await res.json();
|
||||
setMesas(data);
|
||||
} catch (error) {
|
||||
toast.error("Error al cargar mesas disponibles");
|
||||
|
||||
Swal.fire({
|
||||
title: "Error al cargar mesas disponibles!",
|
||||
icon: "error",
|
||||
draggable: true,
|
||||
});
|
||||
} finally {
|
||||
setLoadingMesas(false);
|
||||
}
|
||||
@@ -100,7 +111,12 @@ export default function AsignacionMesas({ idCuenta, inscripcion }: Props) {
|
||||
e.preventDefault();
|
||||
|
||||
if (!mesaSeleccionada) {
|
||||
toast.error("Selecciona un mesa");
|
||||
|
||||
Swal.fire({
|
||||
title: "Seleccione una mesa!",
|
||||
icon: "error",
|
||||
draggable: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -124,14 +140,19 @@ export default function AsignacionMesas({ idCuenta, inscripcion }: Props) {
|
||||
}
|
||||
|
||||
setBitacora([]);
|
||||
toast.success("Mesa asignada correctamente");
|
||||
|
||||
Swal.fire({
|
||||
title: "Mesa asignada correctamente!",
|
||||
icon: "success",
|
||||
draggable: true,
|
||||
});
|
||||
} catch (error) {
|
||||
toast.error("No se pudo asignar la mesa");
|
||||
|
||||
Swal.fire({
|
||||
title: "No se pudo asignar la mesa!",
|
||||
icon: "error",
|
||||
draggable: true,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -192,4 +213,4 @@ export default function AsignacionMesas({ idCuenta, inscripcion }: Props) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
//IO
|
||||
//
|
||||
@@ -6,6 +6,7 @@ import { Alumno, AlumnoSancion, Sancion } from "@/app/types/sanction";
|
||||
import TableSanction from "./TableSanction";
|
||||
import axios from "axios";
|
||||
import toast from "react-hot-toast";
|
||||
import Swal from "sweetalert2";
|
||||
|
||||
if (!envConfig.apiUrl) {
|
||||
console.error("API URL is not defined in envConfig");
|
||||
@@ -13,7 +14,7 @@ if (!envConfig.apiUrl) {
|
||||
|
||||
export default function ApplySanction({ idCuenta }: { idCuenta: number }) {
|
||||
const [sanciones, setSanciones] = useState<Sancion[]>([]);
|
||||
const [alumno, setAlumno] = useState<Alumno >();
|
||||
const [alumno, setAlumno] = useState<Alumno>();
|
||||
const [alumnoSanciones, setAlumnoSanciones] = useState<AlumnoSancion[]>([]);
|
||||
const [selectedSancion, setSelectedSancion] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -28,7 +29,7 @@ export default function ApplySanction({ idCuenta }: { idCuenta: number }) {
|
||||
setAlumno(res.data.student ?? null);
|
||||
setAlumnoSanciones(res.data.alusancion ?? []);
|
||||
} catch {
|
||||
}finally{
|
||||
} finally {
|
||||
setLoadingTable(true)
|
||||
}
|
||||
};
|
||||
@@ -42,15 +43,26 @@ export default function ApplySanction({ idCuenta }: { idCuenta: number }) {
|
||||
.get(`${envConfig.apiUrl}/sancion`)
|
||||
.then((res) => setSanciones(res.data))
|
||||
.catch(() =>
|
||||
toast.error("Error al obtener el catálogo de sanciones")
|
||||
|
||||
Swal.fire({
|
||||
title: "Error al obtener el catálogo de sanciones!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
})
|
||||
);
|
||||
|
||||
}, [idCuenta]);
|
||||
|
||||
const handleButton = async (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
e.preventDefault();
|
||||
|
||||
if (!selectedSancion) {
|
||||
toast.error("Selecciona una sanción");
|
||||
|
||||
Swal.fire({
|
||||
title: "Selecciona una sanción!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -64,9 +76,19 @@ export default function ApplySanction({ idCuenta }: { idCuenta: number }) {
|
||||
|
||||
await fetchAlumnoSanciones();
|
||||
setSelectedSancion("");
|
||||
toast.success("Sanción aplicada correctamente");
|
||||
|
||||
Swal.fire({
|
||||
title: "Sanción aplicada correctamente!",
|
||||
icon: "success",
|
||||
draggable: true
|
||||
});
|
||||
} catch {
|
||||
toast.error("Error al aplicar la sanción");
|
||||
|
||||
Swal.fire({
|
||||
title: "Error al aplicar la sanción!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
@@ -109,9 +109,9 @@ export default function CheckBoxEquipo({ numAcount, machine }: Props) {
|
||||
{ tiempo_asignado: minutos },
|
||||
);
|
||||
|
||||
toast.success("Tiempo cancelado");
|
||||
|
||||
Swal.fire({
|
||||
title: "Tiempo cancelado!",
|
||||
title: "Tiempo cancelado Correctamente!",
|
||||
icon: "success",
|
||||
draggable: true,
|
||||
});
|
||||
@@ -176,4 +176,3 @@ export default function CheckBoxEquipo({ numAcount, machine }: Props) {
|
||||
</>
|
||||
);
|
||||
}
|
||||
//IO
|
||||
@@ -93,9 +93,9 @@ export default function CheckBoxMesa({ numAcount, table }: props) {
|
||||
{ tiempo_asignado: minutos },
|
||||
);
|
||||
|
||||
toast.success("Tiempo cancelado");
|
||||
|
||||
Swal.fire({
|
||||
title: "Tiempo cancelado!",
|
||||
title: "Tiempo cancelado correctamente!",
|
||||
icon: "success",
|
||||
draggable: true,
|
||||
});
|
||||
@@ -160,4 +160,4 @@ export default function CheckBoxMesa({ numAcount, table }: props) {
|
||||
</>
|
||||
);
|
||||
}
|
||||
//IO
|
||||
//I
|
||||
@@ -3,6 +3,7 @@ import axios from "axios";
|
||||
import { envConfig } from "@/app/lib/config";
|
||||
import { useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import Swal from "sweetalert2";
|
||||
|
||||
interface Data {
|
||||
nombre_equipo: string;
|
||||
@@ -84,10 +85,20 @@ export default function Equipos() {
|
||||
});
|
||||
|
||||
setIsEditing(false);
|
||||
toast.success("Equipo actualizado correctamente");
|
||||
|
||||
Swal.fire({
|
||||
title: "Equipo actualizado correctamente!",
|
||||
icon: "success",
|
||||
draggable: true
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
toast.error("Error al guardar el equipo");
|
||||
|
||||
Swal.fire({
|
||||
title: "Error al guardar el equipo!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -118,7 +129,12 @@ export default function Equipos() {
|
||||
setIsCreating(true);
|
||||
setIsEditing(true);
|
||||
} catch (error) {
|
||||
toast.error("Error al preparar formulario");
|
||||
|
||||
Swal.fire({
|
||||
title: "Error al preparar formulario!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -132,7 +148,12 @@ export default function Equipos() {
|
||||
ip: "0.0.0.0",
|
||||
});
|
||||
|
||||
toast.success("Equipo creado correctamente");
|
||||
|
||||
Swal.fire({
|
||||
title: "Equipo creado correctamente!",
|
||||
icon: "success",
|
||||
draggable: true
|
||||
});
|
||||
|
||||
setIsCreating(false);
|
||||
setIsEditing(false);
|
||||
|
||||
@@ -31,17 +31,32 @@ function Impressions({ costs, numAcount, id_servicio }: ImpressionsProps) {
|
||||
|
||||
const handlePayment = async () => {
|
||||
if (!numAcount) {
|
||||
toast.error("busca de nuevo al estudiante");
|
||||
|
||||
Swal.fire({
|
||||
title: "busca de nuevo al estudiante!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pages) {
|
||||
toast.error("Ingresa el numero de hojas a imprimir");
|
||||
|
||||
Swal.fire({
|
||||
title: "Ingresa el numero de hojas a imprimir!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cost) {
|
||||
toast.error("Selecciona un costo");
|
||||
|
||||
Swal.fire({
|
||||
title: "Selecciona un costo!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -63,9 +78,9 @@ function Impressions({ costs, numAcount, id_servicio }: ImpressionsProps) {
|
||||
|
||||
setPages("");
|
||||
setCost("");
|
||||
toast.success("Impresion cobrada correctamente");
|
||||
|
||||
Swal.fire({
|
||||
title: "Cobro exitoso!",
|
||||
title: "Impresion cobrada correctamente!",
|
||||
icon: "success",
|
||||
draggable: true
|
||||
});
|
||||
|
||||
@@ -61,7 +61,12 @@ export default function ProgramSelector({
|
||||
},
|
||||
);
|
||||
|
||||
toast.success("Programas actualizados en la máquina");
|
||||
|
||||
Swal.fire({
|
||||
title: "Programas actualizados en la máquina!",
|
||||
icon: "success",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -71,16 +76,26 @@ export default function ProgramSelector({
|
||||
programas: programasSeleccionados,
|
||||
});
|
||||
|
||||
toast.success("Programas actualizados en la sala");
|
||||
|
||||
Swal.fire({
|
||||
title: "Programas actualizados en la sala",
|
||||
icon: "success",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
toast.error("No se pudo determinar el destino");
|
||||
Swal.fire({
|
||||
title: "No se pudo determinar el destino!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
} catch (error) {
|
||||
toast.error("Error al guardar cambios");
|
||||
|
||||
|
||||
Swal.fire({
|
||||
title: "Error al guardar cambios!",
|
||||
icon: "success",
|
||||
icon: "error",
|
||||
draggable: true,
|
||||
});
|
||||
}
|
||||
@@ -117,13 +132,28 @@ export default function ProgramSelector({
|
||||
} catch (error: any) {
|
||||
if (axios.isAxiosError(error)) {
|
||||
if (error.response?.status === 404) {
|
||||
toast.error("Sin programas asignados");
|
||||
|
||||
Swal.fire({
|
||||
title: "Sin programas asignados!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
} else {
|
||||
toast.error("Error al cargar programas");
|
||||
|
||||
|
||||
Swal.fire({
|
||||
title: "Error al cargar programas!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
|
||||
}
|
||||
} else {
|
||||
toast.error("Error inesperado");
|
||||
|
||||
Swal.fire({
|
||||
title: "Error inesperado!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +165,7 @@ export default function ProgramSelector({
|
||||
|
||||
return (
|
||||
<form className="form-container" onSubmit={handleSubmit}>
|
||||
<div className="checkbox-grid" style={{gridAutoFlow:"column"}}>
|
||||
<div className="checkbox-grid" style={{ gridAutoFlow: "column" }}>
|
||||
{programas.map((prog) => (
|
||||
<label key={prog.id_programa}>
|
||||
<input
|
||||
|
||||
@@ -52,27 +52,52 @@ export default function Inscripcion({
|
||||
|
||||
const handleSaveReceipt = async () => {
|
||||
if (!numAcount) {
|
||||
toast.error("busca de nuevo al estudiante");
|
||||
|
||||
Swal.fire({
|
||||
title: "busca de nuevo al estudiante!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!folio) {
|
||||
toast.error("Ingresa el folio del ticket");
|
||||
|
||||
Swal.fire({
|
||||
title: "Ingresa el folio del ticket!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!amount) {
|
||||
toast.error("Coloca el monto a depositar");
|
||||
|
||||
Swal.fire({
|
||||
title: "Coloca el monto a depositar!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!date) {
|
||||
toast.error("Coloca la fecha");
|
||||
|
||||
Swal.fire({
|
||||
title: "Coloca la fecha!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!plataformaSeleccionada) {
|
||||
toast.error("Selecciona una plataforma");
|
||||
|
||||
Swal.fire({
|
||||
title: "Selecciona una plataforma!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -95,8 +120,8 @@ export default function Inscripcion({
|
||||
{ headers },
|
||||
);
|
||||
|
||||
toast.success("Alumno con pago");
|
||||
Swal.fire("Alumno con pago");
|
||||
|
||||
Swal.fire("Alumno inscrito con pago");
|
||||
setFolio("");
|
||||
setAmount("");
|
||||
setDate(todayISO);
|
||||
@@ -113,12 +138,22 @@ export default function Inscripcion({
|
||||
|
||||
const handleInscripcionSinPago = async () => {
|
||||
if (!numAcount) {
|
||||
toast.error("busca de nuevo al estudiante");
|
||||
|
||||
Swal.fire({
|
||||
title: "busca de nuevo al estudiante!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!plataformaSeleccionada) {
|
||||
toast.error("Selecciona una plataforma");
|
||||
|
||||
Swal.fire({
|
||||
title: "Selecciona una plataforma!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -142,7 +177,7 @@ export default function Inscripcion({
|
||||
throw new Error(data.message || "Error al inscribir");
|
||||
}
|
||||
|
||||
toast.success("Alumno inscrito sin pago");
|
||||
|
||||
Swal.fire({
|
||||
title: "Alumno inscrito sin pago!",
|
||||
icon: "success",
|
||||
@@ -210,7 +245,7 @@ export default function Inscripcion({
|
||||
const numericValue = parseFloat(value);
|
||||
|
||||
if (lock && numericValue > 1000) {
|
||||
toast.error("El monto no puede superar $1000.00");
|
||||
|
||||
Swal.fire({
|
||||
title:
|
||||
"El monto no puede superar $1000.00 Desbloquea el candado !",
|
||||
@@ -222,7 +257,7 @@ export default function Inscripcion({
|
||||
|
||||
|
||||
if (numericValue > 10000) {
|
||||
toast.error("El monto no puede superar $10000.00");
|
||||
|
||||
Swal.fire({
|
||||
title:
|
||||
"El monto no puede superar $10000.00 pesos",
|
||||
|
||||
@@ -33,22 +33,42 @@ function Receipt({ numAcount }: ReceiptsProps) {
|
||||
|
||||
const handleSaveReceipt = async () => {
|
||||
if (!numAcount) {
|
||||
toast.error("busca de nuevo al estudiante");
|
||||
|
||||
Swal.fire({
|
||||
title: "busca de nuevo al estudiante!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!folio) {
|
||||
toast.error("Ingresa el folio del ticket");
|
||||
|
||||
Swal.fire({
|
||||
title: "Ingresa el folio del ticket!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!amount) {
|
||||
toast.error("Coloca el monto a depositar");
|
||||
|
||||
Swal.fire({
|
||||
title: "Coloca el monto a depositar!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!date) {
|
||||
toast.error("Coloca la fecha");
|
||||
|
||||
Swal.fire({
|
||||
title: "Coloca la fecha!",
|
||||
icon: "error",
|
||||
draggable: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -64,9 +84,9 @@ function Receipt({ numAcount }: ReceiptsProps) {
|
||||
setAmount("");
|
||||
setDate(todayISO);
|
||||
|
||||
toast.success("Recibo guardado");
|
||||
|
||||
Swal.fire({
|
||||
title: "Recibo Guardado!",
|
||||
title: "Recibo Guardado Correctamente!",
|
||||
icon: "success",
|
||||
draggable: true
|
||||
});
|
||||
@@ -119,7 +139,7 @@ function Receipt({ numAcount }: ReceiptsProps) {
|
||||
const numericValue = parseFloat(value);
|
||||
|
||||
if (lock && numericValue > 1000) {
|
||||
toast.error("El monto no puede superar $1000.00");
|
||||
|
||||
Swal.fire({
|
||||
title:
|
||||
"El monto no puede superar $1000.00 Desbloquea el candado !",
|
||||
@@ -130,7 +150,7 @@ function Receipt({ numAcount }: ReceiptsProps) {
|
||||
}
|
||||
|
||||
if (numericValue > 10000) {
|
||||
toast.error("El monto no puede superar $10000.00");
|
||||
|
||||
Swal.fire({
|
||||
title:
|
||||
"El monto no puede superar $10000.00 pesos",
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import apiClient from "@/app/lib/apiClient";
|
||||
import { useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import Swal from "sweetalert2";
|
||||
|
||||
export default function ChangePassword() {
|
||||
const [password, setPass] = useState("");
|
||||
@@ -19,7 +20,13 @@ export default function ChangePassword() {
|
||||
setNewPass('');
|
||||
setconfirmNewPass('');
|
||||
}catch{
|
||||
toast.error( `No es la contraseña actual`)
|
||||
|
||||
Swal.fire({
|
||||
title: "No es la contraseña actual!",
|
||||
icon: "error",
|
||||
draggable: true,
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
@@ -85,4 +92,3 @@ export default function ChangePassword() {
|
||||
</section>
|
||||
);
|
||||
}
|
||||
//IO
|
||||
@@ -5,6 +5,7 @@ import { useRouter } from "next/navigation";
|
||||
|
||||
import toast from "react-hot-toast";
|
||||
import "./Login.css";
|
||||
import Swal from "sweetalert2";
|
||||
|
||||
function Login() {
|
||||
const [user, setUser] = useState("");
|
||||
@@ -16,12 +17,22 @@ function Login() {
|
||||
e.preventDefault();
|
||||
|
||||
if (!user) {
|
||||
toast.error("Coloca un usuario");
|
||||
|
||||
Swal.fire({
|
||||
title: "Coloca un usuario!",
|
||||
icon: "error",
|
||||
draggable: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!password) {
|
||||
toast.error("Coloca una contraseña");
|
||||
|
||||
Swal.fire({
|
||||
title: "Coloca una contraseña!",
|
||||
icon: "error",
|
||||
draggable: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -39,7 +50,12 @@ function Login() {
|
||||
document.cookie = `user=${usuario}; path=/; SameSite=Strict`;
|
||||
document.cookie = `role=${role}; path=/; SameSite=Strict`;
|
||||
|
||||
toast.success("Inicio de sesión exitoso");
|
||||
|
||||
Swal.fire({
|
||||
title: "Inicio de sesión exitoso!",
|
||||
icon: "success",
|
||||
draggable: true,
|
||||
});
|
||||
router.push("/Impresiones");
|
||||
router.refresh();
|
||||
}
|
||||
|
||||
Generated
+18
@@ -694,6 +694,7 @@
|
||||
"version": "2.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.6.tgz",
|
||||
"integrity": "sha512-tmmZ3lQxAe/k/+rNnXQRawJ4NjxO2hqiOLTHvWchtGZULp4RyFeh6aU4XdOYBFe2KE1oShQTv4AblOs2iOrNnQ==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
@@ -733,6 +734,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -753,6 +755,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -773,6 +776,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -793,6 +797,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -813,6 +818,7 @@
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -833,6 +839,7 @@
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -853,6 +860,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -873,6 +881,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -893,6 +902,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -913,6 +923,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -933,6 +944,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -953,6 +965,7 @@
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -973,6 +986,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1850,6 +1864,7 @@
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
|
||||
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
@@ -1860,6 +1875,7 @@
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
|
||||
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
@@ -2209,6 +2225,7 @@
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz",
|
||||
"integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
@@ -2255,6 +2272,7 @@
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
|
||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
|
||||
Reference in New Issue
Block a user