From 4c80d9e9705972be4dd43f9564585f58fd57f8c3 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 5 Dec 2024 15:34:43 +0000 Subject: [PATCH] Update layout endpoints --- packages/frontend-core/src/api/layouts.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/frontend-core/src/api/layouts.ts b/packages/frontend-core/src/api/layouts.ts index 159b6585fe..233f60e6c2 100644 --- a/packages/frontend-core/src/api/layouts.ts +++ b/packages/frontend-core/src/api/layouts.ts @@ -1,9 +1,13 @@ -import { Layout, SaveLayoutRequest, SaveLayoutResponse } from "@budibase/types" +import { + DeleteLayoutResponse, + SaveLayoutRequest, + SaveLayoutResponse, +} from "@budibase/types" import { BaseAPIClient } from "./types" export interface LayoutEndpoints { - saveLayout: (layout: Layout) => Promise - deleteLayout: (id: string, rev: string) => Promise<{ message: string }> + saveLayout: (layout: SaveLayoutRequest) => Promise + deleteLayout: (id: string, rev: string) => Promise } export const buildLayoutEndpoints = (API: BaseAPIClient): LayoutEndpoints => ({ @@ -12,7 +16,7 @@ export const buildLayoutEndpoints = (API: BaseAPIClient): LayoutEndpoints => ({ * @param layout the layout to save */ saveLayout: async layout => { - return await API.post({ + return await API.post({ url: "/api/layouts", body: layout, })