Is viewV2 to shared core

This commit is contained in:
Adria Navarro 2024-12-19 19:46:58 +01:00
parent ffab29cdee
commit db9cf128f0
2 changed files with 6 additions and 3 deletions

View File

@ -324,9 +324,7 @@ export async function update(
return pickApi(tableId).update(tableId, view) return pickApi(tableId).update(tableId, view)
} }
export function isV2(view: View | ViewV2): view is ViewV2 { export const isV2 = helpers.views.isV2
return (view as ViewV2).version === 2
}
export async function remove(viewId: string): Promise<ViewV2> { export async function remove(viewId: string): Promise<ViewV2> {
const { tableId } = utils.extractViewInfoFromID(viewId) const { tableId } = utils.extractViewInfoFromID(viewId)

View File

@ -1,5 +1,6 @@
import { import {
BasicViewFieldMetadata, BasicViewFieldMetadata,
View,
ViewCalculationFieldMetadata, ViewCalculationFieldMetadata,
ViewFieldMetadata, ViewFieldMetadata,
ViewV2, ViewV2,
@ -43,3 +44,7 @@ export function basicFields(view: UnsavedViewV2, opts?: { visible?: boolean }) {
return !isCalculationField(field) && (!visible || isVisible(field)) return !isCalculationField(field) && (!visible || isVisible(field))
}) })
} }
export function isV2(view: View | ViewV2): view is ViewV2 {
return (view as ViewV2).version === 2
}