Fixed #398: favorited status of tracks not appearing in interface

environments/review-front-funk-4sh69p/deployments/30
Eliot Berriot 2018-07-24 22:24:56 +02:00
rodzic 8974881f95
commit 1b78ef31c2
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: DD6965E2476E5C27
2 zmienionych plików z 11 dodań i 4 usunięć

Wyświetl plik

@ -0,0 +1 @@
Fixed favorited status of tracks not appearing in interface (#398)

Wyświetl plik

@ -57,13 +57,19 @@ export default {
// will fetch favorites by batches from API to have them locally
let params = {
user: rootState.auth.profile.id,
page_size: 50
page_size: 50,
ordering: '-creation_date'
}
url = url || 'favorites/tracks/'
return axios.get(url, {params: params}).then((response) => {
let promise
if (url) {
promise = axios.get(url)
} else {
promise = axios.get('favorites/tracks/', {params: params})
}
return promise.then((response) => {
logger.default.info('Fetched a batch of ' + response.data.results.length + ' favorites')
response.data.results.forEach(result => {
commit('track', {id: result.track, value: true})
commit('track', {id: result.track.id, value: true})
})
if (response.data.next) {
dispatch('fetch', response.data.next)