From 75f5098dedb4fdf636c1c568ba118c59fbb751ae Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 12 Jun 2024 12:56:26 +0800 Subject: [PATCH] fix: use dataSource.collectionManager.getCollection --- packages/core/data-source-manager/src/default-actions/list.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/data-source-manager/src/default-actions/list.ts b/packages/core/data-source-manager/src/default-actions/list.ts index e3f73cf870185..4be722639f420 100644 --- a/packages/core/data-source-manager/src/default-actions/list.ts +++ b/packages/core/data-source-manager/src/default-actions/list.ts @@ -7,9 +7,9 @@ * For more information, please refer to: https://www.nocobase.com/agreement. */ +import { Context } from '@nocobase/actions'; import { assign, isValidFilter } from '@nocobase/utils'; import { pageArgsToLimitArgs } from './utils'; -import { Context } from '@nocobase/actions'; function totalPage(total, pageSize): number { return Math.ceil(total / pageSize); @@ -24,7 +24,7 @@ function findArgs(ctx: Context) { params.tree = false; } else { const [collectionName, associationName] = resourceName.split('.'); - const collection = ctx.db.getCollection(resourceName); + const collection = ctx.dataSource.collectionManager.getCollection(resourceName); if (collection.options.tree && !(associationName && collectionName === collection.name)) { const foreignKey = collection.treeParentField?.foreignKey || 'parentId'; assign(params, { filter: { [foreignKey]: null } }, { filter: 'andMerge' });