diff --git a/client/components/modals/rssfeed/ViewModal.vue b/client/components/modals/rssfeed/ViewModal.vue
index 32f871ae..0133dc9f 100644
--- a/client/components/modals/rssfeed/ViewModal.vue
+++ b/client/components/modals/rssfeed/ViewModal.vue
@@ -6,13 +6,13 @@
-
+
{{ $strings.HeaderRSSFeedIsOpen }}
-
+
- content_copy
+ content_copy
@@ -28,7 +28,7 @@
-
{{ $strings.ButtonCloseFeed }}
+
{{ $strings.ButtonCloseFeed }}
{{ $strings.ButtonOpenFeed }}
@@ -43,13 +43,16 @@ export default {
type: Object,
default: () => null
},
- feedUrl: String
+ feed: {
+ type: Object,
+ default: () => null
+ }
},
data() {
return {
processing: false,
newFeedSlug: null,
- currentFeedUrl: null
+ currentFeed: null
}
},
watch: {
@@ -106,7 +109,7 @@ export default {
return
}
- var sanitized = this.$sanitizeSlug(this.newFeedSlug)
+ const sanitized = this.$sanitizeSlug(this.newFeedSlug)
if (this.newFeedSlug !== sanitized) {
this.newFeedSlug = sanitized
this.$toast.warning('Slug had to be modified - Run again')
@@ -121,19 +124,15 @@ export default {
console.log('Payload', payload)
this.$axios
- .$post(`/api/items/${this.libraryItemId}/open-feed`, payload)
+ .$post(`/api/feeds/item/${this.libraryItemId}/open`, payload)
.then((data) => {
- if (data.success) {
- console.log('Opened RSS Feed', data)
- this.currentFeedUrl = data.feedUrl
- } else {
- const errorMsg = data.error || 'Unknown error'
- this.$toast.error(errorMsg)
- }
+ console.log('Opened RSS Feed', data)
+ this.currentFeed = data.feed
})
.catch((error) => {
console.error('Failed to open RSS Feed', error)
- this.$toast.error()
+ const errorMsg = error.response ? error.response.data : null
+ this.$toast.error(errorMsg || 'Failed to open RSS Feed')
})
},
copyToClipboard(str) {
@@ -142,22 +141,23 @@ export default {
closeFeed() {
this.processing = true
this.$axios
- .$post(`/api/items/${this.libraryItem.id}/close-feed`)
+ .$post(`/api/feeds/${this.currentFeed.id}/close`)
.then(() => {
this.$toast.success(this.$strings.ToastRSSFeedCloseSuccess)
this.show = false
- this.processing = false
})
.catch((error) => {
console.error('Failed to close RSS feed', error)
- this.processing = false
this.$toast.error(this.$strings.ToastRSSFeedCloseFailed)
})
+ .finally(() => {
+ this.processing = false
+ })
},
init() {
if (!this.libraryItem) return
this.newFeedSlug = this.libraryItem.id
- this.currentFeedUrl = this.feedUrl
+ this.currentFeed = this.feed
}
},
mounted() {}
diff --git a/client/pages/item/_id/index.vue b/client/pages/item/_id/index.vue
index 15890f63..c36fa8e2 100644
--- a/client/pages/item/_id/index.vue
+++ b/client/pages/item/_id/index.vue
@@ -174,7 +174,7 @@
-
+
@@ -200,7 +200,7 @@