Skip to content

Commit

Permalink
fix: return ArrayBuffer instead of string
Browse files Browse the repository at this point in the history
BREAKING-CHANGE: download endpoints return type changed
  • Loading branch information
UnderKoen committed Oct 12, 2023
1 parent 9223c39 commit 9b3f39d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/salesInvoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,30 @@ export class SalesInvoice {
* Download the PDF of the sales invoice
* @returns The content of the PDF
*/
public async downloadPDF(): Promise<string> {
return this.HTTP.GET<string>("download_pdf");
public async downloadPDF(): Promise<ArrayBuffer> {
return this.HTTP.GET<ArrayBuffer>("download_pdf", {
responseType: "arraybuffer",
});
}

/**
* Download the UBL of the sales invoice
* @returns The content of the UBL
*/
public async downloadUBL(): Promise<string> {
return this.HTTP.GET<string>("download_ubl");
public async downloadUBL(): Promise<ArrayBuffer> {
return this.HTTP.GET<ArrayBuffer>("download_ubl", {
responseType: "arraybuffer",
});
}

/**
* Download the packing slip of the sales invoice
* @returns The PDF content of the packing slip
*/
public async downloadPackingSlip(): Promise<string> {
return this.HTTP.GET<string>("download_packing_slip_pdf");
public async downloadPackingSlip(): Promise<ArrayBuffer> {
return this.HTTP.GET<ArrayBuffer>("download_packing_slip_pdf", {
responseType: "arraybuffer",
});
}

/**
Expand Down

0 comments on commit 9b3f39d

Please sign in to comment.