This commit is contained in:
Ahmed Bouhuolia
2026-01-15 22:04:42 +02:00
parent 3c1273becb
commit 2bbc154f18
34 changed files with 301 additions and 176 deletions

View File

@@ -210,7 +210,7 @@ export class SaleInvoicesController {
@Headers('accept') acceptHeader: string,
@Res({ passthrough: true }) res: Response,
) {
if (acceptHeader.includes(AcceptType.ApplicationPdf)) {
if (acceptHeader?.includes(AcceptType.ApplicationPdf)) {
const [pdfContent, filename] =
await this.saleInvoiceApplication.saleInvoicePdf(id);
@@ -219,7 +219,7 @@ export class SaleInvoicesController {
'Content-Length': pdfContent.length,
});
res.send(pdfContent);
} else if (acceptHeader.includes(AcceptType.ApplicationTextHtml)) {
} else if (acceptHeader?.includes(AcceptType.ApplicationTextHtml)) {
const htmlContent = await this.saleInvoiceApplication.saleInvoiceHtml(id);
return { htmlContent };
} else {