Ver código fonte

Invoice

tags/Baseline_30082024_FRONTEND_UAT
MSI\2Fi 1 ano atrás
pai
commit
7eff0285e7
1 arquivos alterados com 3 adições e 3 exclusões
  1. +3
    -3
      src/components/CreateInvoice/CreateInvoice.tsx

+ 3
- 3
src/components/CreateInvoice/CreateInvoice.tsx Ver arquivo

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


Carregando…
Cancelar
Salvar