Skip to content

Commit

Permalink
fix: use dataSource.collectionManager.getCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
chenos committed Jun 12, 2024
1 parent 690b7cd commit 75f5098
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/data-source-manager/src/default-actions/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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' });
Expand Down

0 comments on commit 75f5098

Please sign in to comment.