From b6267e0f96345a1d50a2f6d13081206670ea987f Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Tue, 16 May 2023 19:07:05 +0100 Subject: [PATCH] Fix failing table test --- qa-core/src/internal-api/api/apis/BaseAPI.ts | 8 ++++++-- qa-core/src/internal-api/api/apis/RowAPI.ts | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/qa-core/src/internal-api/api/apis/BaseAPI.ts b/qa-core/src/internal-api/api/apis/BaseAPI.ts index 6edbc10701..b7eae45087 100644 --- a/qa-core/src/internal-api/api/apis/BaseAPI.ts +++ b/qa-core/src/internal-api/api/apis/BaseAPI.ts @@ -44,8 +44,12 @@ export default class BaseAPI { return [response, json] } - async del(url: string, statusCode?: number): Promise<[Response, any]> { - const [response, json] = await this.client.del(url) + async del( + url: string, + statusCode?: number, + body?: any + ): Promise<[Response, any]> { + const [response, json] = await this.client.del(url, { body }) expect(response).toHaveStatusCode(statusCode ? statusCode : 200) return [response, json] } diff --git a/qa-core/src/internal-api/api/apis/RowAPI.ts b/qa-core/src/internal-api/api/apis/RowAPI.ts index c420aec193..c557a22291 100644 --- a/qa-core/src/internal-api/api/apis/RowAPI.ts +++ b/qa-core/src/internal-api/api/apis/RowAPI.ts @@ -28,7 +28,11 @@ export default class RowAPI extends BaseAPI { } async delete(tableId: string, body: any): Promise<[Response, Row[]]> { - const [response, json] = await this.del(`/${tableId}/rows/`, body) + const [response, json] = await this.del( + `/${tableId}/rows/`, + undefined, + body + ) return [response, json] }