1
0
Fork 0
mirror of synced 2024-06-02 02:25:17 +12:00
budibase/qa-core/src/config/internal-api/TestConfiguration/screens.ts

24 lines
680 B
TypeScript
Raw Normal View History

2022-10-22 06:52:39 +13:00
import { Screen } from "@budibase/types"
import { Response } from "node-fetch"
import InternalAPIClient from "./InternalAPIClient"
2022-10-22 06:52:39 +13:00
export default class ScreenApi {
api: InternalAPIClient
constructor(apiClient: InternalAPIClient) {
this.api = apiClient
}
async create(body: any): Promise<[Response, Screen]> {
const response = await this.api.post(`/screens`, { body })
const json = await response.json()
return [response, json]
}
async delete(screenId: string, rev: string): Promise<[Response, Screen]> {
const response = await this.api.del(`/screens/${screenId}/${rev}`)
const json = await response.json()
return [response, json]
}
2022-10-22 06:52:39 +13:00
}