Skip to content

Commit f774112

Browse files
fix(client): preserve URL params already embedded in path
1 parent 399fbc7 commit f774112

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/client.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,9 @@ export class Grid {
271271
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
272272

273273
const defaultQuery = this.defaultQuery();
274-
if (!isEmptyObj(defaultQuery)) {
275-
query = { ...defaultQuery, ...query };
274+
const pathQuery = Object.fromEntries(url.searchParams);
275+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
276+
query = { ...pathQuery, ...defaultQuery, ...query };
276277
}
277278

278279
if (typeof query === 'object' && query && !Array.isArray(query)) {

0 commit comments

Comments
 (0)