mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 11:12:20 +08:00
fix: use dataSource.collectionManager.getCollection
This commit is contained in:
parent
690b7cd636
commit
75f5098ded
@ -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' });
|
||||
|
Loading…
x
Reference in New Issue
Block a user