Merge pull request #286 from answerdev/feat/1.0.8/ui

fix: tag info page delete tag will redirect to tags page
This commit is contained in:
dashuai 2023-03-27 11:24:32 +08:00 committed by GitHub
commit 3cb9b2aa51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -108,7 +108,9 @@ const TagIntroduction = () => {
confirmText: t('delete', { keyPrefix: 'btns' }),
confirmBtnVariant: 'danger',
onConfirm: () => {
deleteTag(tagInfo.tag_id);
deleteTag(tagInfo.tag_id).then(() => {
navigate('/tags', { replace: true });
});
},
});
};

View File

@ -62,10 +62,10 @@ class Request {
} = error.response || {};
const { data = {}, msg = '' } = errModel || {};
if (status === 400) {
if (data.err_type && errConfig?.passingError) {
if (data?.err_type && errConfig?.passingError) {
return errModel;
}
if (data.err_type) {
if (data?.err_type) {
if (data.err_type === 'toast') {
// toast error message
toastStore.getState().show({