From 839fea3893ba07c0efaf9152f83c8656854998e7 Mon Sep 17 00:00:00 2001 From: Akshay Sasidharan Date: Thu, 6 Jun 2024 22:27:10 +0530 Subject: [PATCH] fix query params on postgrest request --- server/src/services/tooljet_db_operations.service.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/src/services/tooljet_db_operations.service.ts b/server/src/services/tooljet_db_operations.service.ts index 496c87cfe0..e9b9b24474 100644 --- a/server/src/services/tooljet_db_operations.service.ts +++ b/server/src/services/tooljet_db_operations.service.ts @@ -75,9 +75,12 @@ export class TooljetDbOperationsService implements QueryService { !isEmpty(offset) && query.push(`offset=${offset}`); } const headers = { 'data-query-id': queryOptions.id, 'tj-workspace-id': queryOptions.organization_id }; - const url = maybeSetSubPath(`/api/tooljet-db/proxy/${tableId}` + `?${query}`); + const url = + query.length > 0 + ? `/api/tooljet-db/proxy/${tableId}` + `?${query.join('&')}` + : `/api/tooljet-db/proxy/${tableId}`; - return await this.proxyPostgrest(url, 'GET', headers); + return await this.proxyPostgrest(maybeSetSubPath(url), 'GET', headers); } async createRow(queryOptions): Promise {