sweetalertcomplet

This commit is contained in:
2026-02-20 14:33:08 -05:00
parent 57714ff36c
commit 960769ea33
16 changed files with 361 additions and 125 deletions
+15 -2
View File
@@ -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,
});
}
};