From aa2d6779cde3622ca3089e0b8787fad907ba139f Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 4 Dec 2024 15:02:16 +0000 Subject: [PATCH] Small view API typing update. --- packages/server/src/api/controllers/view/viewsV2.ts | 10 ++++++---- packages/types/src/api/web/app/view.ts | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/server/src/api/controllers/view/viewsV2.ts b/packages/server/src/api/controllers/view/viewsV2.ts index 986764a697..c99b79d8fa 100644 --- a/packages/server/src/api/controllers/view/viewsV2.ts +++ b/packages/server/src/api/controllers/view/viewsV2.ts @@ -4,7 +4,6 @@ import { Ctx, RequiredKeys, UpdateViewRequest, - ViewResponse, ViewResponseEnriched, ViewV2, BasicViewFieldMetadata, @@ -15,6 +14,9 @@ import { ViewFetchResponseEnriched, CountDistinctCalculationFieldMetadata, CountCalculationFieldMetadata, + CreateViewResponse, + UpdateViewResponse, + DeleteViewResponse, } from "@budibase/types" import { builderSocket, gridSocket } from "../../../websockets" import { helpers } from "@budibase/shared-core" @@ -132,7 +134,7 @@ export async function fetch(ctx: Ctx) { } } -export async function create(ctx: Ctx) { +export async function create(ctx: Ctx) { const view = ctx.request.body const { tableId } = view @@ -159,7 +161,7 @@ export async function create(ctx: Ctx) { gridSocket?.emitViewUpdate(ctx, result) } -export async function update(ctx: Ctx) { +export async function update(ctx: Ctx) { const view = ctx.request.body if (view.version !== 2) { @@ -196,7 +198,7 @@ export async function update(ctx: Ctx) { gridSocket?.emitViewUpdate(ctx, result) } -export async function remove(ctx: Ctx) { +export async function remove(ctx: Ctx) { const { viewId } = ctx.params const view = await sdk.views.remove(viewId) diff --git a/packages/types/src/api/web/app/view.ts b/packages/types/src/api/web/app/view.ts index 2560f7507f..8ce7d5ca9e 100644 --- a/packages/types/src/api/web/app/view.ts +++ b/packages/types/src/api/web/app/view.ts @@ -14,5 +14,7 @@ export interface ViewFetchResponseEnriched { } export interface CreateViewRequest extends Omit {} +export interface CreateViewResponse extends ViewResponse {} export interface UpdateViewRequest extends ViewV2 {} +export interface UpdateViewResponse extends ViewResponse {}