mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
add comments to some store functions
- some refactors to modals
This commit is contained in:
@@ -7,7 +7,10 @@ import state from "./state";
|
||||
* @param playlist_name The name of the playlist to create.
|
||||
*/
|
||||
async function createNewPlaylist(playlist_name: string, track?: Track) {
|
||||
let status = false;
|
||||
let status = {
|
||||
success: false,
|
||||
playlist: <Playlist>{},
|
||||
};
|
||||
|
||||
await axios
|
||||
.post(state.settings.uri + "/playlist/new", {
|
||||
@@ -22,7 +25,8 @@ async function createNewPlaylist(playlist_name: string, track?: Track) {
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
status = true;
|
||||
status.success = true;
|
||||
status.playlist = res.data.playlist;
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err.response.status == 409) {
|
||||
|
||||
Reference in New Issue
Block a user