chore(front): cleanup

This commit is contained in:
Flupsi 2025-06-06 19:32:02 +02:00
parent 5be004ca64
commit 65529429a6
4 changed files with 7 additions and 6 deletions

View File

@ -68,7 +68,7 @@ const performSearch = () => {
} }
watch( watch(
[() => store.state.moderation.lastUpdate, page], () => [store.state.moderation.lastUpdate, page.value],
() => fetchData(), () => fetchData(),
{ immediate: true } { immediate: true }
) )

View File

@ -84,7 +84,7 @@ onMounted(() => {
}) })
watch( watch(
[() => store.state.moderation.lastUpdate, page], () => [store.state.moderation.lastUpdate, page.value],
() => fetchData(), () => fetchData(),
{ immediate: true } { immediate: true }
) )

View File

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { Track, Artist, Library, ArtistCredit } from '~/types' import type { Track, Library } from '~/types'
import { momentFormat } from '~/utils/filters' import { momentFormat } from '~/utils/filters'
import { computed, reactive, ref, watch } from 'vue' import { computed, reactive, ref, watch } from 'vue'
@ -43,7 +43,7 @@ const props = defineProps<Props>()
const object = computed(() => dataStore.get("album", props.id).value) const object = computed(() => dataStore.get("album", props.id).value)
const artistCredit = computed(() => object.value?.artist_credit ?? []) const artistCredit = computed(() => object.value?.artist_credit ?? [])
const artist = computed(() => dataStore.get("artist", artistCredit.value[0].artist.id))
const libraries = ref([] as Library[]) const libraries = ref([] as Library[])
const paginateBy = ref(50) const paginateBy = ref(50)
@ -131,7 +131,8 @@ const remove = async () => {
try { try {
await axios.delete(`albums/${object.value?.id}`) await axios.delete(`albums/${object.value?.id}`)
emit('deleted') emit('deleted')
router.push({ name: 'library.artists.detail', params: { id: artist.value?.id } }) if (artistCredit.value)
router.push({ name: 'library.artists.detail', params: { id: artistCredit.value[0].artist.id } })
} catch (error) { } catch (error) {
useErrorHandler(error as Error) useErrorHandler(error as Error)
} }

View File

@ -61,7 +61,7 @@ const fetchData = async (url = props.url) => {
fetchData() fetchData()
watch( watch(
[() => store.state.moderation.lastUpdate, page], () => [store.state.moderation.lastUpdate, page.value],
() => fetchData(), () => fetchData(),
{ immediate: true } { immediate: true }
) )