fixed mesage to create ticket

This commit is contained in:
2026-02-18 19:14:37 -06:00
parent 13be8d9c35
commit 8688bb028c
4 changed files with 14 additions and 6 deletions
+6 -2
View File
@@ -101,8 +101,12 @@ export default function AddTime({
setAmount("");
setDate(todayISO);
router.refresh();
} catch (err: any) {
toast.error(err.message || "Error al guardar");
} catch (error: any) {
const msg =
error.response?.data?.message ||
error.message ||
"Error desconocido al crear recibo";
toast.error(msg);
}
};
+1 -1
View File
@@ -6,8 +6,8 @@ import Inscripcion from "@/app/Components/Receipt/Inscripcion";
import { GetStudent } from "@/app/lib/getStudent";
import { envConfig } from "@/app/lib/config";
import "./inscripcion.css";
import Link from "next/link";
import "./inscripcion.css";
if (!envConfig.apiUrl) {
console.error("API URL is not defined in envConfig");
+6 -2
View File
@@ -102,8 +102,12 @@ export default function Inscripcion({
setDate(todayISO);
router.refresh();
} catch (err: any) {
toast.error(String(err));
} catch (error: any) {
const msg =
error.response?.data?.message ||
error.message ||
"Error desconocido al crear recibo";
toast.error(String(msg));
}
};
+1 -1
View File
@@ -5,8 +5,8 @@ import { useState } from "react";
import { PostReceipt } from "@/app/lib/postReceipt";
import { useRouter } from "next/navigation";
import "./Receipt.css";
import Swal from "sweetalert2";
import "./Receipt.css";
interface ReceiptsProps {
numAcount: number | null;