fixed name and headers

This commit is contained in:
2026-03-02 18:38:14 -06:00
parent 32bbfe107f
commit 1de700902a
4 changed files with 23 additions and 8 deletions
+6 -1
View File
@@ -3,6 +3,7 @@
import { useEffect, useState } from "react";
import axios from "axios";
import DownloadReporteXLSX from "../Dowload/Reporte";
import Cookies from "js-cookie";
interface Recibo {
id_recibo: number;
@@ -38,9 +39,13 @@ export default function PorRecibos({ desde, hasta }: Props) {
const fetchRecibos = async () => {
setLoading(true);
try {
const token = Cookies.get("token");
const headers = { Authorization: `Bearer ${token}` };
const res = await axios.post(
`${process.env.NEXT_PUBLIC_API_URL}/recibo/rango`,
{ desde, hasta }
{ desde, hasta },
{ headers },
);
setRecibos(res.data);
+6 -1
View File
@@ -2,6 +2,7 @@
import { useEffect, useState } from "react";
import axios from "axios";
import Cookies from "js-cookie";
interface ServicioReporte {
id_servicio: number;
@@ -24,9 +25,13 @@ export default function PorServicio({ desde, hasta }: Props) {
const fetchServicios = async () => {
setLoading(true);
try {
const token = Cookies.get("token");
const headers = { Authorization: `Bearer ${token}` };
const res = await axios.post(
`${process.env.NEXT_PUBLIC_API_URL}/detalle-servicio/rango`,
{ desde, hasta }
{ desde, hasta },
{ headers },
);
setServicios(res.data);