From 398cf99b4ff0feeccac421f87b5c5fba311bcb37 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 2 Aug 2023 13:17:20 +0200 Subject: [PATCH] Handle primaryDisplay on controller --- packages/server/src/api/controllers/view/viewsV2.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/controllers/view/viewsV2.ts b/packages/server/src/api/controllers/view/viewsV2.ts index cd28a1b55f..82e536f62d 100644 --- a/packages/server/src/api/controllers/view/viewsV2.ts +++ b/packages/server/src/api/controllers/view/viewsV2.ts @@ -66,13 +66,14 @@ export async function create(ctx: Ctx) { const schemaUI = await parseSchemaUI(ctx, view) - const parsedView: Omit = { + const parsedView: Omit, "id" | "version"> = { name: view.name, tableId: view.tableId, query: view.query, sort: view.sort, columns: view.schema && Object.keys(view.schema), schemaUI, + primaryDisplay: view.primaryDisplay, } const result = await sdk.views.create(tableId, parsedView) ctx.status = 201 @@ -95,7 +96,7 @@ export async function update(ctx: Ctx) { const { tableId } = view const schemaUI = await parseSchemaUI(ctx, view) - const parsedView: ViewV2 = { + const parsedView: RequiredKeys = { id: view.id, name: view.name, version: view.version, @@ -104,6 +105,7 @@ export async function update(ctx: Ctx) { sort: view.sort, columns: view.schema && Object.keys(view.schema), schemaUI, + primaryDisplay: view.primaryDisplay, } const result = await sdk.views.update(tableId, parsedView)