From 82e4e190fccb506613e266940de4e52839f35adc Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 2 Dec 2024 16:53:00 +0000 Subject: [PATCH] Layout API. --- packages/server/src/api/controllers/layout.ts | 3 ++- packages/types/src/api/web/layout.ts | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/layout.ts b/packages/server/src/api/controllers/layout.ts index c0406f50ac..447b437a23 100644 --- a/packages/server/src/api/controllers/layout.ts +++ b/packages/server/src/api/controllers/layout.ts @@ -3,6 +3,7 @@ import { generateLayoutID, getScreenParams } from "../../db/utils" import { events, context } from "@budibase/backend-core" import { BBContext, + DeleteLayoutResponse, Layout, SaveLayoutRequest, SaveLayoutResponse, @@ -32,7 +33,7 @@ export async function save( ctx.status = 200 } -export async function destroy(ctx: BBContext) { +export async function destroy(ctx: UserCtx) { const db = context.getAppDB() const layoutId = ctx.params.layoutId, layoutRev = ctx.params.layoutRev diff --git a/packages/types/src/api/web/layout.ts b/packages/types/src/api/web/layout.ts index 50512777ef..45f7fb9d0a 100644 --- a/packages/types/src/api/web/layout.ts +++ b/packages/types/src/api/web/layout.ts @@ -3,3 +3,7 @@ import { Layout } from "../../documents" export interface SaveLayoutRequest extends Layout {} export interface SaveLayoutResponse extends Layout {} + +export interface DeleteLayoutResponse { + message: string +}