Browse Source

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

pull/5430/head
Wing-Kam Wong 2 years ago
parent
commit
a335da6248
  1. 6
      packages/nocodb/src/lib/models/Sort.ts

6
packages/nocodb/src/lib/models/Sort.ts

@ -114,8 +114,10 @@ export default class Sort {
ncMeta = Noco.ncMeta ncMeta = Noco.ncMeta
): Promise<Sort[]> { ): Promise<Sort[]> {
if (!viewId) return null; if (!viewId) return null;
let sortList = await NocoCache.getList(CacheScope.SORT, [viewId]); const cachedList = await NocoCache.getList(CacheScope.SORT, [viewId]);
if (!sortList.length) { let { list: sortList } = cachedList;
const { isEmptyList } = cachedList;
if (!isEmptyList && !sortList.length) {
sortList = await ncMeta.metaList2(null, null, MetaTable.SORT, { sortList = await ncMeta.metaList2(null, null, MetaTable.SORT, {
condition: { fk_view_id: viewId }, condition: { fk_view_id: viewId },
orderBy: { orderBy: {

Loading…
Cancel
Save