Skip to content

Commit

Permalink
fix: handle Blob correctly (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoerpenbeck authored Dec 9, 2024
1 parent f0669f7 commit 957e93c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/fft-api/parcel/fftParcelService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ export class FftParcelService {

public async getLabel(parcelId: string, labelDocument: LabelDocument): Promise<Buffer> {
try {
return await this.apiClient.get<Buffer>(
const blob = await this.apiClient.get<Blob>(
`${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;
Expand Down

0 comments on commit 957e93c

Please sign in to comment.