fix(front): correct display artist widget

This commit is contained in:
ArneBo 2025-02-25 10:41:59 +01:00
parent ff32ff7bac
commit e18b193cec
1 changed files with 3 additions and 1 deletions

View File

@ -51,7 +51,7 @@ const fetchData = async (url = 'artists/') => {
const response = await axios.get(url, { params }) const response = await axios.get(url, { params })
nextPage.value = response.data.next nextPage.value = response.data.next
count.value = response.data.count count.value = response.data.count
artists.push(...response.data.results) artists.splice(0, artists.length, ...response.data.results)
} catch (error) { } catch (error) {
useErrorHandler(error as Error) useErrorHandler(error as Error)
} }
@ -89,6 +89,7 @@ watch(
name="empty-state" name="empty-state"
> >
<empty-state <empty-state
style="grid-column: 1 / -1;"
:refresh="true" :refresh="true"
@refresh="fetchData" @refresh="fetchData"
/> />
@ -107,6 +108,7 @@ watch(
<Pagination <Pagination
v-if="artists && count > limit" v-if="artists && count > limit"
v-model:page="page" v-model:page="page"
style="grid-column: 1 / -1;"
:pages="Math.ceil((count || 0) / limit)" :pages="Math.ceil((count || 0) / limit)"
/> />
</Section> </Section>