Skip to content

Commit 4214043

Browse files
committed
refactor: update CreateKnowledgeDialog to refresh user profile after knowledge creation
1 parent f3e5f26 commit 4214043

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

ui/src/views/knowledge/create-component/CreateKnowledgeDialog.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ import BaseForm from '@/views/knowledge/component/BaseForm.vue'
2929
import { MsgSuccess, MsgAlert } from '@/utils/message'
3030
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
3131
import { t } from '@/locales'
32+
import useStore from "@/stores";
3233
const emit = defineEmits(['refresh'])
3334
35+
const { user } = useStore()
3436
const router = useRouter()
3537
const route = useRoute()
3638
const apiType = computed(() => {
@@ -67,6 +69,10 @@ const submitHandle = async () => {
6769
}
6870
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
6971
.postKnowledge(obj, loading)
72+
.then(async (res: any) => {
73+
await user.profile();
74+
return res
75+
})
7076
.then((res: any) => {
7177
MsgSuccess(t('common.createSuccess'))
7278
router.push({

ui/src/views/knowledge/create-component/CreateLarkKnowledgeDialog.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ import BaseForm from '@/views/knowledge/component/BaseForm.vue'
5858
import { MsgSuccess, MsgAlert } from '@/utils/message'
5959
import { t } from '@/locales'
6060
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
61+
import useStore from "@/stores";
6162
const emit = defineEmits(['refresh'])
6263
64+
const { user } = useStore()
6365
const router = useRouter()
6466
const route = useRoute()
6567
const apiType = computed(() => {
@@ -159,6 +161,10 @@ const submitHandle = async () => {
159161
}
160162
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
161163
.postLarkKnowledge(obj, loading)
164+
.then(async (res: any) => {
165+
await user.profile();
166+
return res
167+
})
162168
.then((res: any) => {
163169
MsgSuccess(t('common.createSuccess'))
164170
router.push({

ui/src/views/knowledge/create-component/CreateWebKnowledgeDialog.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ import BaseForm from '@/views/knowledge/component/BaseForm.vue'
5050
import { MsgSuccess, MsgAlert } from '@/utils/message'
5151
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
5252
import { t } from '@/locales'
53+
import useStore from "@/stores";
5354
const emit = defineEmits(['refresh'])
5455
56+
const { user } = useStore()
5557
const router = useRouter()
5658
const route = useRoute()
5759
const apiType = computed(() => {
@@ -113,6 +115,10 @@ const submitHandle = async () => {
113115
}
114116
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
115117
.postWebKnowledge(obj, loading)
118+
.then(async (res: any) => {
119+
await user.profile();
120+
return res
121+
})
116122
.then((res: any) => {
117123
MsgSuccess(t('common.createSuccess'))
118124
router.push({

0 commit comments

Comments
 (0)