diff --git a/packages/core/client/src/collection-manager/Configuration/CollectionFields.tsx b/packages/core/client/src/collection-manager/Configuration/CollectionFields.tsx index ec255a6a9..856ac657b 100644 --- a/packages/core/client/src/collection-manager/Configuration/CollectionFields.tsx +++ b/packages/core/client/src/collection-manager/Configuration/CollectionFields.tsx @@ -74,7 +74,7 @@ const CurrentFields = (props) => { const { resource, targetKey } = props.collectionResource || {}; const { [targetKey]: filterByTk, titleField } = useRecord(); const [loadingRecord, setLoadingRecord] = React.useState(null); - const { updateCollection } = useCollectionManager(); + const { updateCollection, refreshCM } = useCollectionManager(); const columns: TableColumnProps[] = [ { @@ -100,11 +100,12 @@ const CurrentFields = (props) => { resource .update({ filterByTk, values: { titleField: checked ? record.name : 'id' } }) .then(async () => { - const data = await props.refreshAsync(); - if (data?.data) { - updateCollection(data.data); - } + await props.refreshAsync(); + // if (data?.data) { + // // updateCollection(data.data); + // } setLoadingRecord(null); + refreshCM(); }) .catch((err) => { setLoadingRecord(null); @@ -180,7 +181,7 @@ const InheritFields = (props) => { const { [targetKey]: filterByTk, titleField, name } = useRecord(); const [loadingRecord, setLoadingRecord] = React.useState(null); const { t } = useTranslation(); - const { updateCollection } = useCollectionManager(); + const { updateCollection, refreshCM } = useCollectionManager(); const columns: TableColumnProps[] = [ { @@ -206,11 +207,12 @@ const InheritFields = (props) => { resource .update({ filterByTk, values: { titleField: checked ? record.name : 'id' } }) .then(async () => { - const data = await props.refreshAsync(); - if (data?.data) { - updateCollection(data.data); - } + await props.refreshAsync(); + // if (data?.data) { + // updateCollection(data.data); + // } setLoadingRecord(null); + refreshCM(); }) .catch((err) => { setLoadingRecord(null); diff --git a/yarn.lock b/yarn.lock index a379d23f5..fc68fb54b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -20905,6 +20905,13 @@ react-drag-listview@^0.1.9: babel-runtime "^6.26.0" prop-types "^15.5.8" +react-error-boundary@^3.1.4: + version "3.1.4" + resolved "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-3.1.4.tgz#255db92b23197108757a888b01e5b729919abde0" + integrity sha512-uM9uPzZJTF6wRQORmSrvOIgt4lJ9MC1sNgEOj2XGsDTRE4kmpWxg7ENK9EWNKJRMAOY9z0MuF4yIfl6gp4sotA== + dependencies: + "@babel/runtime" "^7.12.5" + react-error-boundary@^4.0.3: version "4.0.3" resolved "https://registry.npmmirror.com/react-error-boundary/-/react-error-boundary-4.0.3.tgz#f811497c06d53ea1206817ee82c6e5c6a27becd9"