From 000dd3e55d01edb27f235d9b3d28581013df8f93 Mon Sep 17 00:00:00 2001 From: ArneBo Date: Sat, 3 May 2025 15:44:34 +0200 Subject: [PATCH] fix(front): enable channel uploads by passing channel uuid instead of whole object --- front/src/components/channels/UploadForm.vue | 96 +++++++++++--------- 1 file changed, 54 insertions(+), 42 deletions(-) diff --git a/front/src/components/channels/UploadForm.vue b/front/src/components/channels/UploadForm.vue index b90ee1e52..5a9783291 100644 --- a/front/src/components/channels/UploadForm.vue +++ b/front/src/components/channels/UploadForm.vue @@ -281,7 +281,7 @@ const uploadedFilesById = computed(() => uploadedFiles.value.reduce((acc: Record // const baseImportMetadata = computed(() => ({ - channel: selectedChannel, + channel: selectedChannel.value?.uuid ?? null, import_status: 'draft', import_metadata: { license: values.license, album: values.album } })) @@ -291,9 +291,13 @@ const uploadImportData = reactive({} as Record) const audioMetadata = reactive({} as Record>) const uploadData = reactive({} as Record) const patchUpload = async (id: string, data: Record) => { - const response = await axios.patch(`uploads/${id}/`, data) - uploadData[id] = response.data - uploadImportData[id] = response.data.import_metadata + try { + const response = await axios.patch(`uploads/${id}/`, data) + uploadData[id] = response.data + uploadImportData[id] = response.data.import_metadata + } catch (error) { + useErrorHandler(error as Error) + } } const fetchAudioMetadata = async (uuid: string) => { @@ -572,49 +576,57 @@ defineExpose({ -

- - -
-