Merge branch '1087-playlists-limit' into 'master'
Fix #1087: Fix playlist modal only listing 50 first playlists See merge request funkwhale/funkwhale!1115
This commit is contained in:
commit
8cd40699e8
|
@ -0,0 +1 @@
|
|||
Fix playlist modal only listing 50 first playlists (#1087)
|
|
@ -25,14 +25,20 @@ export default {
|
|||
}
|
||||
},
|
||||
actions: {
|
||||
fetchOwn ({commit, rootState}) {
|
||||
async fetchOwn ({commit, rootState}) {
|
||||
let userId = rootState.auth.profile.id
|
||||
if (!userId) {
|
||||
return
|
||||
}
|
||||
return axios.get('playlists/', {params: {user: userId}}).then((response) => {
|
||||
commit('playlists', response.data.results)
|
||||
})
|
||||
let playlists = []
|
||||
let url = 'playlists/'
|
||||
while (url != null) {
|
||||
let response = await axios.get(url, {params: {user: userId}})
|
||||
playlists = [...playlists, ...response.data.results]
|
||||
url = response.data.next
|
||||
|
||||
}
|
||||
commit('playlists', playlists)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue