fix(acl): cannot read properties of undefined (reading 'fields')
This commit is contained in:
parent
466aa4987e
commit
54e92918b2
@ -1,5 +1,5 @@
|
|||||||
import { SchemaKey } from '@formily/react';
|
import { SchemaKey } from '@formily/react';
|
||||||
import { reduce ,unionBy} from 'lodash';
|
import { reduce, unionBy } from 'lodash';
|
||||||
import { useContext } from 'react';
|
import { useContext } from 'react';
|
||||||
import { useAPIClient } from '../../api-client';
|
import { useAPIClient } from '../../api-client';
|
||||||
import { CollectionContext } from '../context';
|
import { CollectionContext } from '../context';
|
||||||
@ -11,8 +11,8 @@ export const useCollection = () => {
|
|||||||
const api = useAPIClient();
|
const api = useAPIClient();
|
||||||
const resource = api?.resource(collection?.name);
|
const resource = api?.resource(collection?.name);
|
||||||
const { getInheritCollections, getCurrentCollectionFields } = useCollectionManager();
|
const { getInheritCollections, getCurrentCollectionFields } = useCollectionManager();
|
||||||
const currentFields = collection.fields;
|
const currentFields = collection?.fields || [];
|
||||||
const inheritKeys = getInheritCollections(collection.name);
|
const inheritKeys = getInheritCollections(collection?.name) || [];
|
||||||
const inheritedFields = reduce(
|
const inheritedFields = reduce(
|
||||||
inheritKeys,
|
inheritKeys,
|
||||||
(result, value) => {
|
(result, value) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user