fix: resolve double slash issue in report print functionality (#1051)
* fix print button for report tab modules * fix: resolve double slash in report print URLs - Revert ChromiumlyTenancy changes
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import useApiRequest from './useRequest';
|
import useApiRequest from './useRequest';
|
||||||
|
import { normalizeApiPath } from '../utils';
|
||||||
|
|
||||||
export const useRequestPdf = (httpProps) => {
|
export const useRequestPdf = (httpProps) => {
|
||||||
const apiRequest = useApiRequest();
|
const apiRequest = useApiRequest();
|
||||||
@@ -17,7 +18,7 @@ export const useRequestPdf = (httpProps) => {
|
|||||||
headers: { accept: 'application/pdf' },
|
headers: { accept: 'application/pdf' },
|
||||||
responseType: 'blob',
|
responseType: 'blob',
|
||||||
...httpProps,
|
...httpProps,
|
||||||
url: `/api/${httpProps?.url}`,
|
url: `/api/${normalizeApiPath(httpProps?.url)}`,
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
// Create a Blob from the PDF Stream.
|
// Create a Blob from the PDF Stream.
|
||||||
|
|||||||
Reference in New Issue
Block a user