Migrate RowAPI.patch
This commit is contained in:
parent
58b1c2bca6
commit
4efafaeeaf
|
@ -60,21 +60,12 @@ export class RowAPI extends TestAPI {
|
||||||
patch = async (
|
patch = async (
|
||||||
sourceId: string,
|
sourceId: string,
|
||||||
row: PatchRowRequest,
|
row: PatchRowRequest,
|
||||||
{ expectStatus } = { expectStatus: 200 }
|
expectations?: Expectations
|
||||||
): Promise<Row> => {
|
): Promise<Row> => {
|
||||||
let resp = await this.request
|
return await this._patch<Row>(`/api/${sourceId}/rows`, {
|
||||||
.patch(`/api/${sourceId}/rows`)
|
body: row,
|
||||||
.send(row)
|
expectations,
|
||||||
.set(this.config.defaultHeaders())
|
})
|
||||||
.expect("Content-Type", /json/)
|
|
||||||
if (resp.status !== expectStatus) {
|
|
||||||
throw new Error(
|
|
||||||
`Expected status ${expectStatus} but got ${
|
|
||||||
resp.status
|
|
||||||
}, body: ${JSON.stringify(resp.body)}`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return resp.body as Row
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete = async (
|
delete = async (
|
||||||
|
|
Loading…
Reference in New Issue