fix query params on postgrest request

This commit is contained in:
Akshay Sasidharan 2024-06-06 22:27:10 +05:30
parent 1330afc10b
commit 839fea3893

View file

@ -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<QueryResult> {