kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
fix(ui): expose public channel upload form methods
This commit also returns a function removed during Vue 3 rewrite. (in 1c395c01b0
)
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2307>
pipelines/27771
rodzic
943b50ffda
commit
66473084eb
|
@ -399,6 +399,34 @@ watchEffect(() => {
|
|||
const labels = computed(() => ({
|
||||
editTitle: t('components.channels.UploadForm.button.edit')
|
||||
}))
|
||||
|
||||
const isLoading = ref(false)
|
||||
const publish = async () => {
|
||||
isLoading.value = true
|
||||
|
||||
errors.value = []
|
||||
|
||||
try {
|
||||
await axios.post('uploads/action/', {
|
||||
action: 'publish',
|
||||
objects: uploadedFiles.value.map((file) => file.response?.uuid)
|
||||
})
|
||||
|
||||
store.commit('channels/publish', {
|
||||
uploads: uploadedFiles.value.map((file) => ({ ...file.response, import_status: 'pending' })),
|
||||
channel: selectedChannel.value
|
||||
})
|
||||
} catch (error) {
|
||||
errors.value = (error as BackendError).backendErrors
|
||||
}
|
||||
|
||||
isLoading.value = false
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
step,
|
||||
publish
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
Ładowanie…
Reference in New Issue