fix(front): enable channel uploads by passing channel uuid instead of whole object
This commit is contained in:
parent
ce6b93802d
commit
000dd3e55d
|
@ -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<string, Metadata>)
|
|||
const audioMetadata = reactive({} as Record<string, Record<string, string>>)
|
||||
const uploadData = reactive({} as Record<string, { import_metadata: Metadata }>)
|
||||
const patchUpload = async (id: string, data: Record<string, 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,6 +576,13 @@ defineExpose({
|
|||
</div>
|
||||
<Loader v-else-if="file.active && !file.response" />
|
||||
</div>
|
||||
<Layout
|
||||
stack
|
||||
gap-8
|
||||
>
|
||||
<span v-if="file.error">
|
||||
{{ file.error?.toString() }}
|
||||
</span>
|
||||
<h4 class="ui header">
|
||||
<template v-if="file.metadata.title">
|
||||
{{ file.metadata.title }}
|
||||
|
@ -615,6 +626,7 @@ defineExpose({
|
|||
</template>
|
||||
</div>
|
||||
</h4>
|
||||
</Layout>
|
||||
</div>
|
||||
</Alert>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue