catch vuex action errors
This commit is contained in:
parent
e7f4c9af19
commit
74bee52d4b
@ -47,12 +47,11 @@ export default Vue.extend({
|
||||
},
|
||||
methods: {
|
||||
remove(index: number) {
|
||||
console.log("remove: " + index)
|
||||
this.$api.removeFromPlaylist(this.id, index.toString());
|
||||
this.playlist.tracks.splice(index, 1);
|
||||
return this.$api.removeFromPlaylist(this.id, index.toString());
|
||||
},
|
||||
deletePlaylist() {
|
||||
this.$store.dispatch("deletePlaylist", this.id).then(() => {
|
||||
return this.$store.dispatch("deletePlaylist", this.id).then(() => {
|
||||
this.$router.replace({name: "playlists"})
|
||||
})
|
||||
},
|
||||
|
@ -53,15 +53,16 @@ export default Vue.extend({
|
||||
},
|
||||
methods: {
|
||||
createPlaylist() {
|
||||
this.$store.dispatch("createPlaylist", this.playlistName);
|
||||
const name = this.playlistName;
|
||||
this.playlistName = "";
|
||||
this.showModal = false;
|
||||
return this.$store.dispatch("createPlaylist", name);
|
||||
},
|
||||
onDrop(playlistId: string, event: any) {
|
||||
console.log("onDrop")
|
||||
event.preventDefault();
|
||||
const trackId = event.dataTransfer.getData("id");
|
||||
this.$store.dispatch("addTrackToPlaylist", { playlistId, trackId })
|
||||
return this.$store.dispatch("addTrackToPlaylist", { playlistId, trackId })
|
||||
},
|
||||
onDragover(event: any) {
|
||||
console.log("onDragover")
|
||||
|
Loading…
x
Reference in New Issue
Block a user