feat: wip financial reports printing

This commit is contained in:
Ahmed Bouhuolia
2024-02-18 17:32:17 +02:00
parent 465bb66d6b
commit 3509026ad8
8 changed files with 14 additions and 9 deletions

View File

@@ -2,7 +2,7 @@
import React from 'react';
import useApiRequest from './useRequest';
export const useRequestPdf = (url) => {
export const useRequestPdf = (httpProps) => {
const apiRequest = useApiRequest();
const [isLoading, setIsLoading] = React.useState(false);
const [isLoaded, setIsLoaded] = React.useState(false);
@@ -12,9 +12,10 @@ export const useRequestPdf = (url) => {
React.useEffect(() => {
setIsLoading(true);
apiRequest
.get(url, {
.http({
headers: { accept: 'application/pdf' },
responseType: 'blob',
...httpProps,
})
.then((response) => {
// Create a Blob from the PDF Stream.