Skip to content

Commit defbd26

Browse files
fix(client): preserve URL params already embedded in path
1 parent b50ef46 commit defbd26

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/client.ts

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

475475
const defaultQuery = this.defaultQuery();
476-
if (!isEmptyObj(defaultQuery)) {
477-
query = { ...defaultQuery, ...query };
476+
const pathQuery = Object.fromEntries(url.searchParams);
477+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
478+
query = { ...pathQuery, ...defaultQuery, ...query };
478479
}
479480

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

0 commit comments

Comments
 (0)