From db9cf128f0f0e5a93f18c150216fc03fc099799f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 19 Dec 2024 19:46:58 +0100 Subject: [PATCH] Is viewV2 to shared core --- packages/server/src/sdk/app/views/index.ts | 4 +--- packages/shared-core/src/helpers/views.ts | 5 +++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/server/src/sdk/app/views/index.ts b/packages/server/src/sdk/app/views/index.ts index f483ebc0bc..ad3399d54b 100644 --- a/packages/server/src/sdk/app/views/index.ts +++ b/packages/server/src/sdk/app/views/index.ts @@ -324,9 +324,7 @@ export async function update( return pickApi(tableId).update(tableId, view) } -export function isV2(view: View | ViewV2): view is ViewV2 { - return (view as ViewV2).version === 2 -} +export const isV2 = helpers.views.isV2 export async function remove(viewId: string): Promise { const { tableId } = utils.extractViewInfoFromID(viewId) diff --git a/packages/shared-core/src/helpers/views.ts b/packages/shared-core/src/helpers/views.ts index f0407eeec9..106f8cb6eb 100644 --- a/packages/shared-core/src/helpers/views.ts +++ b/packages/shared-core/src/helpers/views.ts @@ -1,5 +1,6 @@ import { BasicViewFieldMetadata, + View, ViewCalculationFieldMetadata, ViewFieldMetadata, ViewV2, @@ -43,3 +44,7 @@ export function basicFields(view: UnsavedViewV2, opts?: { visible?: boolean }) { return !isCalculationField(field) && (!visible || isVisible(field)) }) } + +export function isV2(view: View | ViewV2): view is ViewV2 { + return (view as ViewV2).version === 2 +}