Przeglądaj źródła

Invoice

tags/Baseline_30082024_FRONTEND_UAT
MSI\2Fi 1 rok temu
rodzic
commit
7eff0285e7
1 zmienionych plików z 3 dodań i 3 usunięć
  1. +3
    -3
      src/components/CreateInvoice/CreateInvoice.tsx

+ 3
- 3
src/components/CreateInvoice/CreateInvoice.tsx Wyświetl plik

@@ -130,8 +130,8 @@ const CreateInvoice: React.FC = ({
// Check if the request was successful
if (response.ok) {
// Extract the filename from the response headers
const contentDisposition = response.headers.get('content-disposition');
console.log(contentDisposition)
const contentDisposition = response.headers.get("Content-Disposition");
// response.headers.forEach(e => console.log(e))
const fileName = contentDisposition
? contentDisposition.split('filename=')[1]
: 'invoice.pdf';
@@ -145,7 +145,7 @@ const CreateInvoice: React.FC = ({
// Create a link element to trigger the file download
const link = document.createElement('a');
link.href = url;
link.download = fileName;
link.download = fileName.replace(/"/g, '');
link.click();
// Clean up the temporary URL


Ładowanie…
Anuluj
Zapisz