From 9fbc1bfd090c2b7fc8af31e560058fafd6a66fa1 Mon Sep 17 00:00:00 2001 From: upsiflu Date: Wed, 26 Mar 2025 14:56:31 +0100 Subject: [PATCH] fix(front): [WIP] override wrong generated type for `get uploads` response --- front/src/components/audio/ChannelForm.vue | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/front/src/components/audio/ChannelForm.vue b/front/src/components/audio/ChannelForm.vue index 5fbb23b39..aaa43e814 100644 --- a/front/src/components/audio/ChannelForm.vue +++ b/front/src/components/audio/ChannelForm.vue @@ -44,7 +44,7 @@ const newValues = reactive({ description: props.object?.artist?.description?.text ?? '', cover: props.object?.artist?.cover?.uuid ?? null, content_category: props.object?.artist?.content_category ?? 'podcast', - metadata: { ...(props.object?.metadata ?? {}) } + metadata: { ...(props.object?.metadata ?? {}) } as Channel['metadata'] }) const tagList = computed(() => ({ @@ -125,10 +125,8 @@ watchEffect(() => emit('submittable', submittable.value)) const fetchMetadataChoices = async () => { try { const response = await axios.get('channels/metadata-choices/') - // Old code expected as a response { language, itunes_category? } - // but actual response is Channel - if (response.data.metadata) - metadataChoices.value = response.data.metadata + // TODO: Fix schema generation so we don't need to typecast here! + metadataChoices.value = response.data as unknown as MetadataChoices } catch (error) { errors.value = (error as BackendError).backendErrors }