Selaa lähdekoodia

Invoice

tags/Baseline_30082024_FRONTEND_UAT
MSI\2Fi 1 vuosi sitten
vanhempi
commit
7eff0285e7
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. +3
    -3
      src/components/CreateInvoice/CreateInvoice.tsx

+ 3
- 3
src/components/CreateInvoice/CreateInvoice.tsx Näytä tiedosto

@@ -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


Ladataan…
Peruuta
Tallenna