From 621bb2e02bfda85c0b7b434f9f51f94c4c978e36 Mon Sep 17 00:00:00 2001 From: Nicholas Wallace Date: Wed, 28 Aug 2024 20:23:46 -0700 Subject: [PATCH] Update: playlist edit toasts --- .../components/modals/playlists/AddCreateModal.vue | 12 ++++++------ client/components/tables/PlaylistItemsTable.vue | 4 ++-- client/components/tables/playlist/ItemTableRow.vue | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client/components/modals/playlists/AddCreateModal.vue b/client/components/modals/playlists/AddCreateModal.vue index 6d8114fb3..3e0c7a9f3 100644 --- a/client/components/modals/playlists/AddCreateModal.vue +++ b/client/components/modals/playlists/AddCreateModal.vue @@ -130,12 +130,12 @@ export default { .$post(`/api/playlists/${playlist.id}/batch/remove`, { items: itemObjects }) .then((updatedPlaylist) => { console.log(`Items removed from playlist`, updatedPlaylist) - this.$toast.success('Playlist item(s) removed') + this.$toast.success(this.$strings.ToastPlaylistUpdateSuccess) this.processing = false }) .catch((error) => { console.error('Failed to remove items from playlist', error) - this.$toast.error('Failed to remove playlist item(s)') + this.$toast.error(this.$strings.ToastPlaylistUpdateFailed) this.processing = false }) }, @@ -148,12 +148,12 @@ export default { .$post(`/api/playlists/${playlist.id}/batch/add`, { items: itemObjects }) .then((updatedPlaylist) => { console.log(`Items added to playlist`, updatedPlaylist) - this.$toast.success('Items added to playlist') + this.$toast.success(this.$strings.ToastPlaylistUpdateSuccess) this.processing = false }) .catch((error) => { console.error('Failed to add items to playlist', error) - this.$toast.error('Failed to add items to playlist') + this.$toast.error(this.$strings.ToastPlaylistUpdateFailed) this.processing = false }) }, @@ -174,14 +174,14 @@ export default { .$post('/api/playlists', newPlaylist) .then((data) => { console.log('New playlist created', data) - this.$toast.success(`Playlist "${data.name}" created`) + this.$toast.success(this.$strings.ToastPlaylistCreateSuccess + ': ' + data.name) this.processing = false this.newPlaylistName = '' }) .catch((error) => { console.error('Failed to create playlist', error) var errMsg = error.response ? error.response.data || '' : '' - this.$toast.error(`Failed to create playlist: ${errMsg}`) + this.$toast.error(this.$strings.ToastPlaylistCreateFailed + ': ' + errMsg) this.processing = false }) } diff --git a/client/components/tables/PlaylistItemsTable.vue b/client/components/tables/PlaylistItemsTable.vue index 3a741bfe0..09811d4a9 100644 --- a/client/components/tables/PlaylistItemsTable.vue +++ b/client/components/tables/PlaylistItemsTable.vue @@ -92,7 +92,7 @@ export default { }) .catch((error) => { console.error('Failed to update playlist', error) - this.$toast.error('Failed to save playlist items order') + this.$toast.error(this.$strings.ToastPlaylistUpdateFailed) }) }, init() { @@ -119,4 +119,4 @@ export default { .playlist-item-leave-active { position: absolute; } - \ No newline at end of file + diff --git a/client/components/tables/playlist/ItemTableRow.vue b/client/components/tables/playlist/ItemTableRow.vue index 61fe14513..f7cc7d7b7 100644 --- a/client/components/tables/playlist/ItemTableRow.vue +++ b/client/components/tables/playlist/ItemTableRow.vue @@ -218,12 +218,12 @@ export default { this.$toast.success(this.$strings.ToastPlaylistRemoveSuccess) } else { console.log(`Item removed from playlist`, updatedPlaylist) - this.$toast.success('Item removed from playlist') + this.$toast.success(this.$strings.ToastPlaylistUpdateSuccess) } }) .catch((error) => { console.error('Failed to remove item from playlist', error) - this.$toast.error('Failed to remove item from playlist') + this.$toast.error(this.$strings.ToastPlaylistUpdateFailed) }) .finally(() => { this.processingRemove = false