From a217ed5574db8a1a6dc0fc8791a0ea8e2d226797 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sun, 27 Nov 2022 12:17:58 -0600 Subject: [PATCH] Update:Handle edit playlist item --- client/components/tables/PlaylistItemsTable.vue | 12 +++++++++++- client/components/tables/playlist/ItemTableRow.vue | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/client/components/tables/PlaylistItemsTable.vue b/client/components/tables/PlaylistItemsTable.vue index 8346f7f4..11d5c0fb 100644 --- a/client/components/tables/PlaylistItemsTable.vue +++ b/client/components/tables/PlaylistItemsTable.vue @@ -12,7 +12,7 @@ @@ -68,6 +68,16 @@ export default { } }, methods: { + editItem(playlistItem) { + if (playlistItem.episode) { + this.$store.commit('globals/setSelectedEpisode', playlist.episode) + this.$store.commit('globals/setShowEditPodcastEpisodeModal', true) + } else { + const itemIds = this.items.map((i) => i.libraryItemId) + this.$store.commit('setBookshelfBookIds', itemIds) + this.$store.commit('showEditModal', playlistItem.libraryItem) + } + }, draggableUpdate() { var playlistUpdate = { items: this.itemsCopy.map((i) => ({ libraryItemId: i.libraryItemId, episodeId: i.episodeId })) diff --git a/client/components/tables/playlist/ItemTableRow.vue b/client/components/tables/playlist/ItemTableRow.vue index 7688f6a5..29ec8e5b 100644 --- a/client/components/tables/playlist/ItemTableRow.vue +++ b/client/components/tables/playlist/ItemTableRow.vue @@ -183,7 +183,7 @@ export default { }) }, clickEdit() { - // todo: edit + this.$emit('edit', this.item) }, toggleFinished() { var updatePayload = {