Skip to content

Commit 942842e

Browse files
committed
feat: enhance application creation flow with loading state management
1 parent 6f392b7 commit 942842e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

ui/src/views/application/component/CreateApplicationDialog.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,15 @@ const submitHandle = async (formEl: FormInstance | undefined) => {
237237
workflowDefault.value.nodes[0].properties.node_data.name = applicationForm.value.name
238238
applicationForm.value['work_flow'] = workflowDefault.value
239239
}
240+
loading.value=true
240241
applicationApi
241-
.postApplication({ ...applicationForm.value, folder_id: currentFolder.value }, loading)
242-
.then(async (res) => {
243-
await user.profile()
242+
.postApplication({ ...applicationForm.value, folder_id: currentFolder.value })
243+
.then((res) => {
244+
return user.profile().then(() => {
245+
return res
246+
})
247+
})
248+
.then((res) => {
244249
MsgSuccess(t('common.createSuccess'))
245250
emit('refresh')
246251
if (isWorkFlow(applicationForm.value.type)) {
@@ -249,6 +254,8 @@ const submitHandle = async (formEl: FormInstance | undefined) => {
249254
router.push({ path: `/application/workspace/${res.data.id}/${res.data.type}/setting` })
250255
}
251256
dialogVisible.value = false
257+
}).finally(() => {
258+
loading.value=false
252259
})
253260
}
254261
})

0 commit comments

Comments
 (0)