From 8ce7ca1bb2e6bd49d9606b359c010aae8b0cecfd Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Tue, 11 Oct 2022 15:08:08 +0100 Subject: [PATCH] Add types for response --- .../config/internal-api/TestConfiguration/applications.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/applications.ts b/qa-core/src/config/internal-api/TestConfiguration/applications.ts index 0372e50b0b..7d17250e2b 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/applications.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/applications.ts @@ -4,6 +4,8 @@ import { Response } from "node-fetch" import InternalAPIClient from "./InternalAPIClient" import FormData from "form-data" +type messageResponse = { message: string } + export default class AppApi { api: InternalAPIClient @@ -47,7 +49,7 @@ export default class AppApi { return [response, json.data] } - async sync(appId: string): Promise<[Response, any]> { + async sync(appId: string): Promise<[Response, messageResponse]> { const response = await this.api.post(`/applications/${appId}/sync`) const json = await response.json() return [response, json] @@ -59,7 +61,7 @@ export default class AppApi { return [response, json] } - async revert(appId: string): Promise<[Response, { message: string }]> { + async revert(appId: string): Promise<[Response, messageResponse]> { const response = await this.api.post(`/dev/${appId}/revert`) const json = await response.json() return [response, json]