fixed name and headers
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user