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(() => ({
|
const baseImportMetadata = computed(() => ({
|
||||||
channel: selectedChannel,
|
channel: selectedChannel.value?.uuid ?? null,
|
||||||
import_status: 'draft',
|
import_status: 'draft',
|
||||||
import_metadata: { license: values.license, album: values.album }
|
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 audioMetadata = reactive({} as Record<string, Record<string, string>>)
|
||||||
const uploadData = reactive({} as Record<string, { import_metadata: Metadata }>)
|
const uploadData = reactive({} as Record<string, { import_metadata: Metadata }>)
|
||||||
const patchUpload = async (id: string, data: Record<string, Metadata>) => {
|
const patchUpload = async (id: string, data: Record<string, Metadata>) => {
|
||||||
|
try {
|
||||||
const response = await axios.patch(`uploads/${id}/`, data)
|
const response = await axios.patch(`uploads/${id}/`, data)
|
||||||
uploadData[id] = response.data
|
uploadData[id] = response.data
|
||||||
uploadImportData[id] = response.data.import_metadata
|
uploadImportData[id] = response.data.import_metadata
|
||||||
|
} catch (error) {
|
||||||
|
useErrorHandler(error as Error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const fetchAudioMetadata = async (uuid: string) => {
|
const fetchAudioMetadata = async (uuid: string) => {
|
||||||
|
@ -572,6 +576,13 @@ defineExpose({
|
||||||
</div>
|
</div>
|
||||||
<Loader v-else-if="file.active && !file.response" />
|
<Loader v-else-if="file.active && !file.response" />
|
||||||
</div>
|
</div>
|
||||||
|
<Layout
|
||||||
|
stack
|
||||||
|
gap-8
|
||||||
|
>
|
||||||
|
<span v-if="file.error">
|
||||||
|
{{ file.error?.toString() }}
|
||||||
|
</span>
|
||||||
<h4 class="ui header">
|
<h4 class="ui header">
|
||||||
<template v-if="file.metadata.title">
|
<template v-if="file.metadata.title">
|
||||||
{{ file.metadata.title }}
|
{{ file.metadata.title }}
|
||||||
|
@ -615,6 +626,7 @@ defineExpose({
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</h4>
|
</h4>
|
||||||
|
</Layout>
|
||||||
</div>
|
</div>
|
||||||
</Alert>
|
</Alert>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue