Browse Source

fix: if table list missing id fallback to the parameter value

pull/8708/head
Pranav C 6 months ago
parent
commit
180c5206e6
  1. 9
      packages/nc-gui/composables/useMetas.ts

9
packages/nc-gui/composables/useMetas.ts

@ -79,13 +79,8 @@ export const useMetas = createSharedComposable(() => {
if (!force && metas.value[tableIdOrTitle]) {
return metas.value[tableIdOrTitle]
}
const modelId = (tables.find((t) => t.id === tableIdOrTitle) || tables.find((t) => t.title === tableIdOrTitle))?.id
if (!modelId) {
console.warn(`Table '${tableIdOrTitle}' is not found in the table list`)
return null
}
const modelId =
(tables.find((t) => t.id === tableIdOrTitle) || tables.find((t) => t.title === tableIdOrTitle))?.id || tableIdOrTitle
const model = await $api.dbTable.read(modelId)
metas.value = {

Loading…
Cancel
Save