fix: data source add field refresh(T-3253) (#3645)

This commit is contained in:
jack zhang 2024-03-12 15:13:56 +08:00 committed by GitHub
parent 37b97c6e52
commit de6e8469d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,6 +22,7 @@ import {
useCurrentAppInfo, useCurrentAppInfo,
useAPIClient, useAPIClient,
useFieldInterfaceOptions, useFieldInterfaceOptions,
useDataSourceManager,
} from '@nocobase/client'; } from '@nocobase/client';
import { ForeignKey } from './components'; import { ForeignKey } from './components';
@ -157,6 +158,7 @@ const useCreateCollectionField = () => {
const api = useAPIClient(); const api = useAPIClient();
const record = useRecord(); const record = useRecord();
const { name: dataSourceKey } = useParams(); const { name: dataSourceKey } = useParams();
const dm = useDataSourceManager();
return { return {
async run() { async run() {
await form.submit(); await form.submit();
@ -176,6 +178,7 @@ const useCreateCollectionField = () => {
data: values, data: values,
}); });
ctx.setVisible(false); ctx.setVisible(false);
dm.getDataSource(dataSourceKey).reload();
await form.reset(); await form.reset();
field.data.loading = false; field.data.loading = false;
refresh(); refresh();