From 2e8718624e1b05de62a94d855f20d52876f1252f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 28 Sep 2023 07:48:59 +0545 Subject: [PATCH] fix list invoices --- src/lib/sdk/billing.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/sdk/billing.ts b/src/lib/sdk/billing.ts index 07159fb911..3ceee65c48 100644 --- a/src/lib/sdk/billing.ts +++ b/src/lib/sdk/billing.ts @@ -365,14 +365,17 @@ export class Billing { async listInvoices( organizationId: string, queries: Query[] = [], - search = '' + search ): Promise { const path = `/organizations/${organizationId}/invoices`; const params = { organizationId, queries, - search }; + + if (typeof search !== 'undefined') { + params['search'] = search; + } const uri = new URL(this.client.config.endpoint + path); return await this.client.call( 'get',