diff --git a/resources/assets/js/mixins/song-menu-methods.js b/resources/assets/js/mixins/song-menu-methods.js index 8757737e..830de624 100644 --- a/resources/assets/js/mixins/song-menu-methods.js +++ b/resources/assets/js/mixins/song-menu-methods.js @@ -1,4 +1,3 @@ -import { $ } from '../utils' import { queueStore, playlistStore, favoriteStore } from '../stores' /** diff --git a/resources/assets/js/services/download.js b/resources/assets/js/services/download.js index eba3ca59..4472f94a 100644 --- a/resources/assets/js/services/download.js +++ b/resources/assets/js/services/download.js @@ -1,8 +1,7 @@ -import { map, reduce } from 'lodash' +import { reduce } from 'lodash' import { playlistStore, favoriteStore } from '../stores' import { ls } from '.' -import { $ } from '../utils' export const download = { /** @@ -12,7 +11,7 @@ export const download = { */ fromSongs (songs) { songs = [].concat(songs) - const query = reduce(songs, (q, song) => `songs[]=${song.id}&${segment}`, '') + const query = reduce(songs, (q, song) => `songs[]=${song.id}&${q}`, '') return this.trigger(`songs?${query}`) }, diff --git a/resources/assets/js/stores/song.js b/resources/assets/js/stores/song.js index 44eb3278..44bb1ea3 100644 --- a/resources/assets/js/stores/song.js +++ b/resources/assets/js/stores/song.js @@ -216,7 +216,7 @@ export const songStore = { scrobble (song) { return new Promise((resolve, reject) => { http.post(`${song.id}/scrobble/${song.playStartTime}`, {}, response => { - resolve(data.response) + resolve(response.data) }, error => reject(error)) }) }, diff --git a/resources/assets/js/stores/user.js b/resources/assets/js/stores/user.js index ee4e7a00..a9f690cc 100644 --- a/resources/assets/js/stores/user.js +++ b/resources/assets/js/stores/user.js @@ -197,7 +197,7 @@ export const userStore = { NProgress.start() return new Promise((resolve, reject) => { - http.delete(`user/${user.id}`, {}, () => { + http.delete(`user/${user.id}`, {}, response => { this.all = without(this.all, user) alerts.success(`User "${user.name}" deleted.`) diff --git a/resources/assets/js/utils/$.js b/resources/assets/js/utils/$.js index 81b26cba..bd12a3ae 100644 --- a/resources/assets/js/utils/$.js +++ b/resources/assets/js/utils/$.js @@ -43,7 +43,7 @@ export const $ = { if (el.scrollTop === to) { return } - this.scrollTo(el, to, duration - 10); + this.scrollTo(el, to, duration - 10) }, 10) } }