fix: avoid crash when field is deleted in Collapse
This commit is contained in:
parent
62381e5953
commit
4e84b14bc7
@ -980,7 +980,7 @@ export const useAssociationFilterBlockProps = () => {
|
|||||||
const fieldSchema = useFieldSchema();
|
const fieldSchema = useFieldSchema();
|
||||||
const optionalFieldList = useOptionalFieldList();
|
const optionalFieldList = useOptionalFieldList();
|
||||||
const { getDataBlocks } = useFilterBlock();
|
const { getDataBlocks } = useFilterBlock();
|
||||||
const collectionFieldName = collectionField.name;
|
const collectionFieldName = collectionField?.name;
|
||||||
const field = useField();
|
const field = useField();
|
||||||
|
|
||||||
let list, handleSearchInput, params, run, data, valueKey, labelKey, filterKey;
|
let list, handleSearchInput, params, run, data, valueKey, labelKey, filterKey;
|
||||||
|
@ -29,7 +29,7 @@ export const useCollection = () => {
|
|||||||
return {
|
return {
|
||||||
...collection,
|
...collection,
|
||||||
resource,
|
resource,
|
||||||
getField(name: SchemaKey): CollectionFieldOptions | null {
|
getField(name: SchemaKey): CollectionFieldOptions | undefined {
|
||||||
const fields = totalFields as any[];
|
const fields = totalFields as any[];
|
||||||
return fields?.find((field) => field.name === name);
|
return fields?.find((field) => field.name === name);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user