mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
feat: wip financial reports printing
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user