Layout API.

This commit is contained in:
mike12345567 2024-12-02 16:53:00 +00:00
parent bb4d7e0b32
commit 82e4e190fc
2 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import { generateLayoutID, getScreenParams } from "../../db/utils"
import { events, context } from "@budibase/backend-core" import { events, context } from "@budibase/backend-core"
import { import {
BBContext, BBContext,
DeleteLayoutResponse,
Layout, Layout,
SaveLayoutRequest, SaveLayoutRequest,
SaveLayoutResponse, SaveLayoutResponse,
@ -32,7 +33,7 @@ export async function save(
ctx.status = 200 ctx.status = 200
} }
export async function destroy(ctx: BBContext) { export async function destroy(ctx: UserCtx<void, DeleteLayoutResponse>) {
const db = context.getAppDB() const db = context.getAppDB()
const layoutId = ctx.params.layoutId, const layoutId = ctx.params.layoutId,
layoutRev = ctx.params.layoutRev layoutRev = ctx.params.layoutRev

View File

@ -3,3 +3,7 @@ import { Layout } from "../../documents"
export interface SaveLayoutRequest extends Layout {} export interface SaveLayoutRequest extends Layout {}
export interface SaveLayoutResponse extends Layout {} export interface SaveLayoutResponse extends Layout {}
export interface DeleteLayoutResponse {
message: string
}