From d7255bf293331336fc859f3b4c02cf2ccc8c5d52 Mon Sep 17 00:00:00 2001 From: wvffle Date: Thu, 19 Jan 2023 21:23:09 +0000 Subject: [PATCH] fix: fix tsc linter Part-of: --- front/src/components/channels/UploadForm.vue | 2 +- front/src/components/channels/UploadMetadataForm.vue | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/front/src/components/channels/UploadForm.vue b/front/src/components/channels/UploadForm.vue index 1d5ea25cf..e849282da 100644 --- a/front/src/components/channels/UploadForm.vue +++ b/front/src/components/channels/UploadForm.vue @@ -213,7 +213,7 @@ const uploadedFilesById = computed(() => uploadedFiles.value.reduce((acc: Record // // Metadata // -type Metadata = Pick & { cover: string } +type Metadata = Pick & { cover: string | null, description: string } const uploadImportData = reactive({} as Record) const audioMetadata = reactive({} as Record>) const uploadData = reactive({} as Record) diff --git a/front/src/components/channels/UploadMetadataForm.vue b/front/src/components/channels/UploadMetadataForm.vue index 236f0d7c3..589cf1495 100644 --- a/front/src/components/channels/UploadMetadataForm.vue +++ b/front/src/components/channels/UploadMetadataForm.vue @@ -6,14 +6,14 @@ import { reactive, computed, watch } from 'vue' import TagsSelector from '~/components/library/TagsSelector.vue' import AttachmentInput from '~/components/common/AttachmentInput.vue' -type Values = Pick & { cover: string } +type Values = Pick & { cover: string | null, description: string } interface Events { (e: 'update:values', values: Values): void } interface Props { upload: Upload - values: Values | null + values: Partial | null } const emit = defineEmits() @@ -23,7 +23,10 @@ const props = withDefaults(defineProps(), { const newValues = reactive({ description: '', - ...(props.values ?? props.upload.import_metadata ?? {}) as Values + title: '', + tags: [], + cover: null, + ...(props.values ?? props.upload.import_metadata ?? {}) }) const isLoading = computed(() => !props.upload)