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