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 +}