From f3d19962b9763e92e67a487d9914f015db4a69b8 Mon Sep 17 00:00:00 2001
From: IO <320154041@pcpuma.acatlan.unam.mx>
Date: Mon, 23 Feb 2026 14:37:28 -0600
Subject: [PATCH] axios costos
---
app/(private)/Impresiones/page.tsx | 41 +++++++++++++++++++++---------
1 file changed, 29 insertions(+), 12 deletions(-)
diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx
index 17840ab..637c177 100644
--- a/app/(private)/Impresiones/page.tsx
+++ b/app/(private)/Impresiones/page.tsx
@@ -8,6 +8,8 @@ import ShowError from "@/app/Components/Global/ShowError";
import { cookies } from "next/headers";
import { GetStudentWhitoutSancion } from "@/app/lib/getStudentWhitoutSancion";
+import axios from "axios";
+
import "@/app/globals.css";
export default async function Page(props: {
@@ -26,6 +28,7 @@ export default async function Page(props: {
let student: any = null;
let errorMessage = "";
+ let costos: any[] = [];
if (numAcount) {
const result = await GetStudentWhitoutSancion(parseInt(numAcount));
@@ -37,6 +40,24 @@ export default async function Page(props: {
}
}
+ try {
+ const response = await axios.get("http://localhost:5000/costo");
+ costos = response.data;
+ } catch (error) {
+ console.error("Error obteniendo costos:", error);
+ }
+
+
+ const getCostsByService = (id_servicio: number) => {
+ return costos
+ .filter((c) => c.id_servicio === id_servicio)
+ .map((c) => ({
+ value: Number(c.costo),
+ id_costo: c.id_costo,
+ fecha_registro: c.fecha_registro,
+ }));
+ };
+
let options: any[] = [];
if (student) {
@@ -51,7 +72,7 @@ export default async function Page(props: {
label: "Impresiones B/N",
content: (