Merge branch 'feat/ui-0.7.0' into 'test'

refactor(customize): Optimization of custom settings update

See merge request opensource/answer!339
This commit is contained in:
贾海涛(龙笛) 2022-12-15 01:47:52 +00:00
commit 9d4ab8d6c9
1 changed files with 2 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import { getPageCustom, putPageCustom } from '@/services';
import { SchemaForm, JSONSchema, initFormData, UISchema } from '@/components';
import { useToast } from '@/hooks';
import { handleFormError } from '@/utils';
import { customizeStore } from '@/stores';
const Index: FC = () => {
const { t } = useTranslation('translation', {
@ -68,7 +69,6 @@ const Index: FC = () => {
},
};
const [formData, setFormData] = useState(initFormData(schema));
const onSubmit = (evt) => {
evt.preventDefault();
evt.stopPropagation();
@ -86,9 +86,7 @@ const Index: FC = () => {
msg: t('update', { keyPrefix: 'toast' }),
variant: 'success',
});
setTimeout(() => {
window.location.reload();
}, 3000);
customizeStore.getState().update(reqParams);
})
.catch((err) => {
if (err.isError) {