diff --git a/front/src/components/audio/EmbedWizard.vue b/front/src/components/audio/EmbedWizard.vue index 3fb976f46..b6077cf23 100644 --- a/front/src/components/audio/EmbedWizard.vue +++ b/front/src/components/audio/EmbedWizard.vue @@ -12,7 +12,8 @@ import Spacer from '~/components/ui/Spacer.vue' interface Props { type: string - id: number + id?: number + uuid?: string } const { t } = useI18n() @@ -44,7 +45,8 @@ const iframeSrc = computed(() => { ? `&b=${instanceUrl}` : '' - return `${base}embed.html?&type=${props.type}&id=${props.id}${bParam}` + const identifier = props.id ?? props.uuid + return `${base}embed.html?&type=${props.type}&id=${identifier}${bParam}` }) const frameWidth = computed(() => width.value ?? '100%') diff --git a/front/src/components/playlists/Editor.vue b/front/src/components/playlists/Editor.vue index 06dd129b5..b3c1500a3 100644 --- a/front/src/components/playlists/Editor.vue +++ b/front/src/components/playlists/Editor.vue @@ -92,7 +92,7 @@ const responseHandlers = { const fetchTracks = async () => { // NOTE: This is handled by other functions and never used directly - const response = await axios.get(`playlists/${playlist.value?.id}/tracks/`) + const response = await axios.get(`playlists/${playlist.value?.uuid}/tracks/`) playlistTracks.value = response.data.results } @@ -101,7 +101,7 @@ const reorder = async ({ oldIndex: from, newIndex: to }: { oldIndex: number, new isLoading.value = true try { - await axios.post(`playlists/${playlist.value?.id}/move/`, { from, to }) + await axios.post(`playlists/${playlist.value?.uuid}/move/`, { from, to }) await store.dispatch('playlists/fetchOwn') responseHandlers.success() } catch (error) { @@ -116,7 +116,7 @@ const removePlaylistTrack = async (index: number) => { try { tracks.value.splice(index, 1) - await axios.post(`playlists/${playlist.value?.id}/remove/`, { index }) + await axios.post(`playlists/${playlist.value?.uuid}/remove/`, { index }) await Promise.all([ store.dispatch('playlists/fetchOwn'), fetchTracks() @@ -134,7 +134,7 @@ const clearPlaylist = async () => { try { tracks.value = [] - await axios.delete(`playlists/${playlist.value?.id}/clear/`) + await axios.delete(`playlists/${playlist.value?.uuid}/clear/`) await store.dispatch('playlists/fetchOwn') responseHandlers.success() } catch (error) { @@ -148,7 +148,7 @@ const insertMany = async (insertedTracks: number[], allowDuplicates: boolean) => isLoading.value = true try { - const response = await axios.post(`playlists/${playlist.value?.id}/add/`, { + const response = await axios.post(`playlists/${playlist.value?.uuid}/add/`, { allow_duplicates: allowDuplicates, tracks: insertedTracks }) diff --git a/front/src/components/playlists/Form.vue b/front/src/components/playlists/Form.vue index d1aba09d0..27d34bcda 100644 --- a/front/src/components/playlists/Form.vue +++ b/front/src/components/playlists/Form.vue @@ -67,7 +67,7 @@ const submit = async () => { errors.value = [] try { - const url = props.create ? 'playlists/' : `playlists/${playlist.value?.id}/` + const url = props.create ? 'playlists/' : `playlists/${playlist.value?.uuid}/` const method = props.create ? 'post' : 'patch' const data = { diff --git a/front/src/components/playlists/PlaylistDropdown.vue b/front/src/components/playlists/PlaylistDropdown.vue index b092c93bb..70143a447 100644 --- a/front/src/components/playlists/PlaylistDropdown.vue +++ b/front/src/components/playlists/PlaylistDropdown.vue @@ -69,7 +69,7 @@ const deletePlaylist = async () => { try { await axios.delete(`playlists/${props.playlist.uuid}/`) store.dispatch('playlists/fetchOwn') - return router.push({ path: '/library' }) + await router.push({ path: '/library' }) // <-- await instead of return } catch (error) { useErrorHandler(error as Error) } @@ -161,7 +161,7 @@ const showDeleteModal = ref(false)