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
wvffle 2022-12-27 13:54:33 +00:00 zatwierdzone przez Marge
rodzic 943b50ffda
commit 66473084eb
1 zmienionych plików z 28 dodań i 0 usunięć

Wyświetl plik

@ -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>