mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 11:56:47 +00:00
refactor: useRefreshActionProps
This commit is contained in:
parent
7bee4ca2f9
commit
863d000c37
@ -26,7 +26,6 @@ import { message } from 'antd';
|
||||
import { getCollectionSchema } from './schema/collections';
|
||||
import { CollectionFields } from './CollectionFields';
|
||||
import { EditCollection } from './EditCollectionAction';
|
||||
import { DataSourceContext } from '../../DatabaseConnectionProvider';
|
||||
|
||||
/**
|
||||
* @param service
|
||||
@ -134,8 +133,6 @@ export const ConfigurationTable = () => {
|
||||
const api = useAPIClient();
|
||||
const field = useField();
|
||||
field.data = field.data || {};
|
||||
const dm = useDataSourceManagerV2();
|
||||
const { setDataSource } = useContext(DataSourceContext);
|
||||
return {
|
||||
async onClick() {
|
||||
field.data.loading = true;
|
||||
@ -147,8 +144,6 @@ export const ConfigurationTable = () => {
|
||||
field.data.loading = false;
|
||||
service?.refresh?.();
|
||||
message.success(t('Data source synchronization in progress'));
|
||||
dm.getDataSource(name).reload();
|
||||
setDataSource(dm.getDataSource(name));
|
||||
} catch (error) {
|
||||
field.data.loading = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user