1
0
Fork 0
mirror of synced 2024-06-02 02:25:17 +12:00

Add types for response

This commit is contained in:
Pedro Silva 2022-10-11 15:08:08 +01:00
parent db709c6a4d
commit a81500e5f0

View file

@ -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]