From 58a799aea42ff9138a7ef18c4a97dc9c3e63a78e Mon Sep 17 00:00:00 2001 From: sealday Date: Wed, 24 Apr 2024 02:58:22 +0800 Subject: [PATCH] fix: old version get stream (#825) Co-authored-by: sealday Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/825 --- .changeset/bright-coats-report.md | 5 +++++ .../plugin-rental/src/server/actions/records-controller.ts | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/bright-coats-report.md diff --git a/.changeset/bright-coats-report.md b/.changeset/bright-coats-report.md new file mode 100644 index 000000000..8a46b3f4e --- /dev/null +++ b/.changeset/bright-coats-report.md @@ -0,0 +1,5 @@ +--- +"@hera/plugin-rental": patch +--- + +fix get-stream diff --git a/packages/plugins/@hera/plugin-rental/src/server/actions/records-controller.ts b/packages/plugins/@hera/plugin-rental/src/server/actions/records-controller.ts index 11c211061..4e0a3432c 100644 --- a/packages/plugins/@hera/plugin-rental/src/server/actions/records-controller.ts +++ b/packages/plugins/@hera/plugin-rental/src/server/actions/records-controller.ts @@ -8,7 +8,7 @@ import _ from 'lodash'; import { FilterParser, Repository } from '@nocobase/database'; import { CollectionRepository } from '@nocobase/plugin-collection-manager'; import { Cache } from '@nocobase/cache'; -import { getStreamAsBuffer } from 'get-stream'; +import getStream from 'get-stream'; import { stringify } from 'flatted'; @Controller('records') @@ -237,7 +237,8 @@ export class RecordPreviewController { ctx.body = Buffer.from(result.data); } } else { - const buf = await getStreamAsBuffer( + const buf = await getStream.buffer( + // @ts-ignore await this.recordPdfService.transformPdfV2(record, leaseData, feeData, { isDouble: double, printSetup }), ); ctx.body = buf;