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 (
sourceId: string,
params?: SearchParams,
{ expectStatus } = { expectStatus: 200 }
expectations?: Expectations
): Promise<SearchRowResponse> => {
const request = this.request
.post(`/api/${sourceId}/search`)
.send(params)
.set(this.config.defaultHeaders())
.expect(expectStatus)
return (await request).body
return await this._post<SearchRowResponse>(`/api/${sourceId}/search`, {
body: params,
expectations,
})
}
}