1
0
Fork 0
mirror of synced 2024-07-14 18:55:45 +12:00
This commit is contained in:
Adria Navarro 2023-07-19 22:37:24 +02:00
parent 56e6d48ec7
commit fbccec64c7
2 changed files with 2 additions and 2 deletions

View file

@ -280,7 +280,7 @@ export function generateViewID(tableId: string) {
return `${tableId}${SEPARATOR}${newid()}`
}
export function extractViewInfoFromId(viewId: string) {
export function extractViewInfoFromID(viewId: string) {
const regex = new RegExp(`^(?<tableId>.+)${SEPARATOR}([^${SEPARATOR}]+)$`)
const res = regex.exec(viewId)
return {

View file

@ -5,7 +5,7 @@ import sdk from "../../../sdk"
import * as utils from "../../../db/utils"
export async function get(viewId: string): Promise<ViewV2 | undefined> {
const { tableId } = utils.extractViewInfoFromId(viewId)
const { tableId } = utils.extractViewInfoFromID(viewId)
const table = await sdk.tables.getTable(tableId)
const views = Object.values(table.views!)
const view = views.find(v => isV2(v) && v.id === viewId) as ViewV2 | undefined