Check if playlist has name when creating a new playlist.
This commit is contained in:
parent
6a05acf939
commit
b68b9e2c1e
1 changed files with 14 additions and 13 deletions
|
@ -64,19 +64,20 @@ export default {
|
||||||
},
|
},
|
||||||
createPlaylist() {
|
createPlaylist() {
|
||||||
const name = prompt(this.$t("actions.create_playlist"));
|
const name = prompt(this.$t("actions.create_playlist"));
|
||||||
this.fetchJson(this.apiUrl() + "/user/playlists/create", null, {
|
if (name)
|
||||||
method: "POST",
|
this.fetchJson(this.apiUrl() + "/user/playlists/create", null, {
|
||||||
body: JSON.stringify({
|
method: "POST",
|
||||||
name: name,
|
body: JSON.stringify({
|
||||||
}),
|
name: name,
|
||||||
headers: {
|
}),
|
||||||
Authorization: this.getAuthToken(),
|
headers: {
|
||||||
"Content-Type": "application/json",
|
Authorization: this.getAuthToken(),
|
||||||
},
|
"Content-Type": "application/json",
|
||||||
}).then(json => {
|
},
|
||||||
if (json.error) alert(json.error);
|
}).then(json => {
|
||||||
else this.fetchPlaylists();
|
if (json.error) alert(json.error);
|
||||||
});
|
else this.fetchPlaylists();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue