refactor: update CreateKnowledgeDialog to refresh user profile after knowledge creation
This commit is contained in:
parent
f3e5f26caf
commit
4214043674
@ -29,8 +29,10 @@ import BaseForm from '@/views/knowledge/component/BaseForm.vue'
|
|||||||
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
|
import useStore from "@/stores";
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
|
|
||||||
|
const { user } = useStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const apiType = computed(() => {
|
const apiType = computed(() => {
|
||||||
@ -67,6 +69,10 @@ const submitHandle = async () => {
|
|||||||
}
|
}
|
||||||
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
||||||
.postKnowledge(obj, loading)
|
.postKnowledge(obj, loading)
|
||||||
|
.then(async (res: any) => {
|
||||||
|
await user.profile();
|
||||||
|
return res
|
||||||
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
MsgSuccess(t('common.createSuccess'))
|
MsgSuccess(t('common.createSuccess'))
|
||||||
router.push({
|
router.push({
|
||||||
|
|||||||
@ -58,8 +58,10 @@ import BaseForm from '@/views/knowledge/component/BaseForm.vue'
|
|||||||
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
|
import useStore from "@/stores";
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
|
|
||||||
|
const { user } = useStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const apiType = computed(() => {
|
const apiType = computed(() => {
|
||||||
@ -159,6 +161,10 @@ const submitHandle = async () => {
|
|||||||
}
|
}
|
||||||
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
||||||
.postLarkKnowledge(obj, loading)
|
.postLarkKnowledge(obj, loading)
|
||||||
|
.then(async (res: any) => {
|
||||||
|
await user.profile();
|
||||||
|
return res
|
||||||
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
MsgSuccess(t('common.createSuccess'))
|
MsgSuccess(t('common.createSuccess'))
|
||||||
router.push({
|
router.push({
|
||||||
|
|||||||
@ -50,8 +50,10 @@ import BaseForm from '@/views/knowledge/component/BaseForm.vue'
|
|||||||
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
|
import useStore from "@/stores";
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
|
|
||||||
|
const { user } = useStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const apiType = computed(() => {
|
const apiType = computed(() => {
|
||||||
@ -113,6 +115,10 @@ const submitHandle = async () => {
|
|||||||
}
|
}
|
||||||
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
||||||
.postWebKnowledge(obj, loading)
|
.postWebKnowledge(obj, loading)
|
||||||
|
.then(async (res: any) => {
|
||||||
|
await user.profile();
|
||||||
|
return res
|
||||||
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
MsgSuccess(t('common.createSuccess'))
|
MsgSuccess(t('common.createSuccess'))
|
||||||
router.push({
|
router.push({
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user