Improve api

This commit is contained in:
Adria Navarro 2023-09-12 19:59:37 +02:00
parent fccb2f625c
commit f0872c1fa3
1 changed files with 16 additions and 1 deletions

View File

@ -22,6 +22,21 @@ export class RowAPI extends TestAPI {
return request 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 ( save = async (
sourceId: string, sourceId: string,
row: SaveRowRequest, row: SaveRowRequest,
@ -51,7 +66,7 @@ export class RowAPI extends TestAPI {
delete = async ( delete = async (
sourceId: string, sourceId: string,
rows: Row[], rows: Row | string | (Row | string)[],
{ expectStatus } = { expectStatus: 200 } { expectStatus } = { expectStatus: 200 }
) => { ) => {
return this.request return this.request