From e608089557395e7300f64c2d0e9fb75aec7952a8 Mon Sep 17 00:00:00 2001 From: wvffle Date: Thu, 30 Jun 2022 22:07:54 +0000 Subject: [PATCH] Fix router warnings --- front/src/components/channels/UploadModal.vue | 117 +++++------- .../src/components/common/AttachmentInput.vue | 2 +- .../components/playlists/PlaylistModal.vue | 180 ++++++++---------- front/src/store/playlists.ts | 5 +- front/src/types.ts | 10 +- 5 files changed, 144 insertions(+), 170 deletions(-) diff --git a/front/src/components/channels/UploadModal.vue b/front/src/components/channels/UploadModal.vue index 84f30a7bb..85f1c3b41 100644 --- a/front/src/components/channels/UploadModal.vue +++ b/front/src/components/channels/UploadModal.vue @@ -1,3 +1,51 @@ + + - - diff --git a/front/src/components/common/AttachmentInput.vue b/front/src/components/common/AttachmentInput.vue index 07082a895..ab9c9c845 100644 --- a/front/src/components/common/AttachmentInput.vue +++ b/front/src/components/common/AttachmentInput.vue @@ -26,7 +26,7 @@ const value = useVModel(props, 'modelValue', emit) const attachment = ref() const isLoading = ref(false) -const errors = reactive([]) +const errors = reactive([] as Error[]) const attachmentId = Math.random().toString(36).substring(7) const input = ref() diff --git a/front/src/components/playlists/PlaylistModal.vue b/front/src/components/playlists/PlaylistModal.vue index 943105336..055dfba5f 100644 --- a/front/src/components/playlists/PlaylistModal.vue +++ b/front/src/components/playlists/PlaylistModal.vue @@ -1,3 +1,82 @@ + + - - diff --git a/front/src/store/playlists.ts b/front/src/store/playlists.ts index 2c824476d..87f3fbd1d 100644 --- a/front/src/store/playlists.ts +++ b/front/src/store/playlists.ts @@ -1,11 +1,12 @@ import axios from 'axios' import { Module } from 'vuex' import { RootState } from '~/store/index' +import { Playlist, Track } from '~/types' export interface State { - playlists: any[] + playlists: Playlist[] showModal: boolean - modalTrack: null + modalTrack: null | Track } const store: Module = { diff --git a/front/src/types.ts b/front/src/types.ts index c843641a3..43aa2145f 100644 --- a/front/src/types.ts +++ b/front/src/types.ts @@ -87,13 +87,19 @@ export interface License { url: string } +export interface Playlist { + id: string + name: string + modification_date: Date // TODO (wvffle): Find correct type +} + // API stuff export interface APIErrorResponse { [key: string]: APIErrorResponse | string[] } -export interface BackendError extends AxiosError { - backendErrors: string[] +export interface BackendError { + backendErrors: AxiosError[] rawPayload?: object }