From 9e7ed0471905eaa5eb5ba3fdf7444c733e6c7858 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 2 Oct 2024 18:43:07 +0100 Subject: [PATCH] Support saving queryUI. --- packages/server/src/api/controllers/view/viewsV2.ts | 6 ++++-- packages/types/src/api/web/app/view.ts | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/server/src/api/controllers/view/viewsV2.ts b/packages/server/src/api/controllers/view/viewsV2.ts index 3df7172de2..0257c86ded 100644 --- a/packages/server/src/api/controllers/view/viewsV2.ts +++ b/packages/server/src/api/controllers/view/viewsV2.ts @@ -99,10 +99,11 @@ export async function create(ctx: Ctx) { const schema = await parseSchema(view) - const parsedView: Omit, "id" | "version" | "queryUI"> = { + const parsedView: Omit, "id" | "version"> = { name: view.name, tableId: view.tableId, query: view.query, + queryUI: view.queryUI, sort: view.sort, schema, primaryDisplay: view.primaryDisplay, @@ -132,12 +133,13 @@ export async function update(ctx: Ctx) { const { tableId } = view const schema = await parseSchema(view) - const parsedView: RequiredKeys> = { + const parsedView: RequiredKeys = { id: view.id, name: view.name, version: view.version, tableId: view.tableId, query: view.query, + queryUI: view.queryUI, sort: view.sort, schema, primaryDisplay: view.primaryDisplay, diff --git a/packages/types/src/api/web/app/view.ts b/packages/types/src/api/web/app/view.ts index a99f2938ab..a6be5e2986 100644 --- a/packages/types/src/api/web/app/view.ts +++ b/packages/types/src/api/web/app/view.ts @@ -9,7 +9,6 @@ export interface ViewResponseEnriched { data: ViewV2Enriched } -export interface CreateViewRequest - extends Omit {} +export interface CreateViewRequest extends Omit {} -export interface UpdateViewRequest extends Omit {} +export interface UpdateViewRequest extends ViewV2 {}