1
0
Fork 0
mirror of synced 2024-08-09 15:17:57 +12:00

Improve api

This commit is contained in:
Adria Navarro 2023-09-12 19:59:37 +02:00
parent fccb2f625c
commit f0872c1fa3

View file

@ -22,6 +22,21 @@ export class RowAPI extends TestAPI {
return request
}
getEnriched = async (
sourceId: string,
rowId: string,
{ expectStatus } = { expectStatus: 200 }
) => {
const request = this.request
.get(`/api/${sourceId}/rows/${rowId}/enrich`)
.set(this.config.defaultHeaders())
.expect(expectStatus)
if (expectStatus !== 404) {
request.expect("Content-Type", /json/)
}
return request
}
save = async (
sourceId: string,
row: SaveRowRequest,
@ -51,7 +66,7 @@ export class RowAPI extends TestAPI {
delete = async (
sourceId: string,
rows: Row[],
rows: Row | string | (Row | string)[],
{ expectStatus } = { expectStatus: 200 }
) => {
return this.request