🔷 add Update playlist modal

This commit is contained in:
geoffrey45
2022-04-08 06:46:45 +03:00
parent 0e946974a3
commit 657daa389f
5 changed files with 312 additions and 18 deletions
+10 -4
View File
@@ -1,8 +1,9 @@
import { defineStore } from "pinia";
import { Track } from "../interfaces";
import { Playlist, Track } from "../interfaces";
enum ModalOptions {
newPlaylist,
editPlaylist,
newPlaylist = "newPlaylist",
updatePlaylist = "editPlaylist",
}
export default defineStore("newModal", {
@@ -10,7 +11,7 @@ export default defineStore("newModal", {
title: "",
options: ModalOptions,
component: "",
props: {},
props: <any>{},
visible: false,
}),
actions: {
@@ -23,6 +24,11 @@ export default defineStore("newModal", {
this.props.track = track;
this.visible = true;
},
showEditPlaylistModal(playlist: Playlist) {
this.component = ModalOptions.updatePlaylist;
this.props = playlist;
this.visible = true;
},
hideModal() {
this.visible = false;
},
+3
View File
@@ -13,5 +13,8 @@ export default defineStore("playlist-tracks", {
this.info = playlist.info;
this.tracks = playlist.tracks;
},
updatePInfo(info: Playlist) {
this.info = info;
},
},
});