Browse Source

refactor(nocodb): adopt getList new format in Model.ts

pull/5430/head
Wing-Kam Wong 2 years ago
parent
commit
ae34cb67e0
  1. 10
      packages/nocodb/src/lib/models/Model.ts

10
packages/nocodb/src/lib/models/Model.ts

@ -160,13 +160,15 @@ export default class Model implements TableType {
}, },
ncMeta = Noco.ncMeta ncMeta = Noco.ncMeta
): Promise<Model[]> { ): Promise<Model[]> {
let modelList = []; let cachedList;
if (base_id) { if (base_id) {
await NocoCache.getList(CacheScope.MODEL, [project_id, base_id]); cachedList = await NocoCache.getList(CacheScope.MODEL, [project_id, base_id]);
} else { } else {
await NocoCache.getList(CacheScope.MODEL, [project_id]); cachedList = await NocoCache.getList(CacheScope.MODEL, [project_id]);
} }
if (!modelList.length) { let { list: modelList } = cachedList;
const { isEmptyList } = cachedList;
if (!isEmptyList && !modelList.length) {
modelList = await ncMeta.metaList2( modelList = await ncMeta.metaList2(
project_id, project_id,
base_id, base_id,

Loading…
Cancel
Save