Skip to content

Commit 951856e

Browse files
committed
Use client.defaults.paramsSerializer if possible
1 parent 56f04b7 commit 951856e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/lib/seam/connect/seam-http-request.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@ export class SeamHttpRequest<
5555
if (params === undefined) {
5656
return new URL(this.#config.path, baseUrl)
5757
}
58-
return new URL(
59-
`${this.#config.path}?${serializeUrlSearchParams(params)}`,
60-
baseUrl,
61-
)
58+
59+
const serializer =
60+
typeof client.defaults.paramsSerializer === 'function'
61+
? client.defaults.paramsSerializer
62+
: serializeUrlSearchParams
63+
64+
return new URL(`${this.#config.path}?${serializer(params)}`, baseUrl)
6265
}
6366

6467
public get method(): Method {

0 commit comments

Comments
 (0)