From 305a7c70c495d629e6cb2034b3a328bd6de22aef Mon Sep 17 00:00:00 2001 From: Arno Erpenbeck <88486704+arnoerpenbeck@users.noreply.github.com> Date: Mon, 9 Dec 2024 12:04:16 +0100 Subject: [PATCH] fix: handle Blob correctly --- src/fft-api/parcel/fftParcelService.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fft-api/parcel/fftParcelService.ts b/src/fft-api/parcel/fftParcelService.ts index 622ff71..fa307e1 100644 --- a/src/fft-api/parcel/fftParcelService.ts +++ b/src/fft-api/parcel/fftParcelService.ts @@ -27,11 +27,12 @@ export class FftParcelService { public async getLabel(parcelId: string, labelDocument: LabelDocument): Promise { try { - return await this.apiClient.get( + const blob = await this.apiClient.get( `${this.path}/${parcelId}/labels/${labelDocument}`, undefined, ResponseType.BLOB ); + return Buffer.from(await blob.arrayBuffer()); } catch (err) { this.log.error(`Could not get label ${labelDocument} for parcel with id '${parcelId}'.`, err); throw err;