From 1c395c01b0f30e13e86a81650ea5630026c3b8b7 Mon Sep 17 00:00:00 2001 From: wvffle Date: Sun, 31 Jul 2022 23:42:59 +0000 Subject: [PATCH] Migrate upload form --- front/src/components/channels/AlbumSelect.vue | 12 +- .../src/components/channels/LicenseSelect.vue | 15 +- front/src/components/channels/UploadForm.vue | 824 +++++++++--------- .../channels/UploadMetadataForm.vue | 6 +- front/src/components/channels/UploadModal.vue | 3 +- front/src/store/channels.ts | 10 +- front/src/types.ts | 5 +- 7 files changed, 441 insertions(+), 434 deletions(-) diff --git a/front/src/components/channels/AlbumSelect.vue b/front/src/components/channels/AlbumSelect.vue index 4d24dcde1..4c0000791 100644 --- a/front/src/components/channels/AlbumSelect.vue +++ b/front/src/components/channels/AlbumSelect.vue @@ -5,16 +5,21 @@ import axios from 'axios' import { useVModel } from '@vueuse/core' import { reactive, ref, watch } from 'vue' +interface Emits { + (e: 'update:modelValue', value: string): void +} + interface Props { - modelValue: number + modelValue: string | null channel: Channel | null } +const emit = defineEmits() const props = withDefaults(defineProps(), { + modelValue: null, channel: null }) -const emit = defineEmits(['update:modelValue']) const value = useVModel(props, 'modelValue', emit) const albums = reactive([]) @@ -36,8 +41,7 @@ const fetchData = async () => { isLoading.value = false } -watch(() => props.channel, fetchData) -fetchData() +watch(() => props.channel, fetchData, { immediate: true })