Skip to content

Commit f963b61

Browse files
committed
Rename query -> params because it's more inline with our naming
1 parent af32603 commit f963b61

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

generate-routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ const renderClassMethod = ({
374374
return new SeamHttpRequest(this, {
375375
path: '${path}',
376376
method: '${snakeCase(method)}', ${
377-
requestFormat === 'params' ? 'query: params,' : ''
378-
} ${requestFormat === 'body' ? 'body: body,' : ''}
377+
requestFormat === 'params' ? 'params,' : ''
378+
} ${requestFormat === 'body' ? 'body,' : ''}
379379
responseKey: ${resource === null ? 'undefined' : `'${resource}'`},
380380
${resource === 'action_attempt' ? 'options' : ''}
381381
})

src/lib/seam/connect/routes/connect-webviews.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface SeamHttpRequestConfig<TBody, TResponseKey> {
1515
readonly path: string
1616
readonly method: Method
1717
readonly body?: TBody
18-
readonly query?: undefined | Record<string, unknown>
18+
readonly params?: undefined | Record<string, unknown>
1919
readonly responseKey: TResponseKey
2020
readonly options?: Pick<SeamHttpRequestOptions, 'waitForActionAttempt'>
2121
}
@@ -51,12 +51,12 @@ export class SeamHttpRequest<
5151
throw new Error('baseUrl is required')
5252
}
5353

54-
const query = this.#config.query
55-
if (query === undefined) {
54+
const params = this.#config.params
55+
if (params === undefined) {
5656
return new URL(this.#config.path, baseUrl)
5757
}
5858
return new URL(
59-
`${this.#config.path}?${serializeUrlSearchParams(query)}`,
59+
`${this.#config.path}?${serializeUrlSearchParams(params)}`,
6060
baseUrl,
6161
)
6262
}
@@ -77,7 +77,7 @@ export class SeamHttpRequest<
7777
url: this.#config.path,
7878
method: this.#config.method,
7979
data: this.#config.body as TBody,
80-
params: this.#config.query,
80+
params: this.#config.params,
8181
})
8282
if (this.responseKey === undefined) {
8383
return undefined as TResponseKey extends keyof TResponse

0 commit comments

Comments
 (0)