mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 23:49:27 +08:00
fix(tree): cannot read properties of undefined (reading 'tree')
This commit is contained in:
parent
6ea55cdd43
commit
8abfae5824
@ -7,9 +7,9 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import lodash from 'lodash';
|
import { CountOptions, FindAndCountOptions, FindOptions, Model, Repository, Transactionable } from '@nocobase/database';
|
||||||
import { CountOptions, FindOptions, Repository, FindAndCountOptions, Transactionable, Model } from '@nocobase/database';
|
|
||||||
import { isValidFilter } from '@nocobase/utils';
|
import { isValidFilter } from '@nocobase/utils';
|
||||||
|
import lodash from 'lodash';
|
||||||
import { TreeCollection } from './tree-collection';
|
import { TreeCollection } from './tree-collection';
|
||||||
|
|
||||||
export class AdjacencyListRepository extends Repository {
|
export class AdjacencyListRepository extends Repository {
|
||||||
@ -207,7 +207,8 @@ export class AdjacencyListRepository extends Repository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async count(countOptions?: CountOptions & { raw?: boolean; tree?: boolean }): Promise<number> {
|
async count(countOptions?: CountOptions & { raw?: boolean; tree?: boolean }): Promise<number> {
|
||||||
if (countOptions.raw || !countOptions.tree) {
|
countOptions = countOptions || {};
|
||||||
|
if (countOptions?.raw || !countOptions?.tree) {
|
||||||
return await super.count(countOptions);
|
return await super.count(countOptions);
|
||||||
}
|
}
|
||||||
if (!isValidFilter(countOptions.filter) && !countOptions.filterByTk) {
|
if (!isValidFilter(countOptions.filter) && !countOptions.filterByTk) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user