Migrate RowAPI.search

This commit is contained in:
Sam Rose 2024-03-01 17:13:46 +00:00
parent c0907d37ef
commit f91db6d985
No known key found for this signature in database
1 changed files with 5 additions and 8 deletions

View File

@ -134,14 +134,11 @@ export class RowAPI extends TestAPI {
search = async ( search = async (
sourceId: string, sourceId: string,
params?: SearchParams, params?: SearchParams,
{ expectStatus } = { expectStatus: 200 } expectations?: Expectations
): Promise<SearchRowResponse> => { ): Promise<SearchRowResponse> => {
const request = this.request return await this._post<SearchRowResponse>(`/api/${sourceId}/search`, {
.post(`/api/${sourceId}/search`) body: params,
.send(params) expectations,
.set(this.config.defaultHeaders()) })
.expect(expectStatus)
return (await request).body
} }
} }