fix(front): [WIP] override wrong generated type for `get uploads` response

This commit is contained in:
upsiflu 2025-03-26 14:56:31 +01:00
parent 180d23ab7c
commit 9fbc1bfd09
1 changed files with 3 additions and 5 deletions

View File

@ -44,7 +44,7 @@ const newValues = reactive({
description: props.object?.artist?.description?.text ?? '', description: props.object?.artist?.description?.text ?? '',
cover: props.object?.artist?.cover?.uuid ?? null, cover: props.object?.artist?.cover?.uuid ?? null,
content_category: props.object?.artist?.content_category ?? 'podcast', content_category: props.object?.artist?.content_category ?? 'podcast',
metadata: { ...(props.object?.metadata ?? {}) } metadata: { ...(props.object?.metadata ?? {}) } as Channel['metadata']
}) })
const tagList = computed(() => ({ const tagList = computed(() => ({
@ -125,10 +125,8 @@ watchEffect(() => emit('submittable', submittable.value))
const fetchMetadataChoices = async () => { const fetchMetadataChoices = async () => {
try { try {
const response = await axios.get<paths['/api/v2/channels/metadata-choices/']['get']['responses']['200']['content']['application/json']>('channels/metadata-choices/') const response = await axios.get<paths['/api/v2/channels/metadata-choices/']['get']['responses']['200']['content']['application/json']>('channels/metadata-choices/')
// Old code expected as a response { language, itunes_category? } // TODO: Fix schema generation so we don't need to typecast here!
// but actual response is Channel metadataChoices.value = response.data as unknown as MetadataChoices
if (response.data.metadata)
metadataChoices.value = response.data.metadata
} catch (error) { } catch (error) {
errors.value = (error as BackendError).backendErrors errors.value = (error as BackendError).backendErrors
} }