diff --git a/pages/item/_id.vue b/pages/item/_id.vue index 3c011697..5a2dced5 100644 --- a/pages/item/_id.vue +++ b/pages/item/_id.vue @@ -46,6 +46,7 @@ {{ downloadItem ? 'downloading' : 'download' }} + @@ -102,6 +103,7 @@ export default { data() { return { resettingProgress: false, + isProcessingReadUpdate: false, showSelectLocalFolder: false } }, @@ -351,7 +353,22 @@ export default { console.log('New local library item', item.id) this.$set(this.libraryItem, 'localLibraryItem', item) } - } + }, + toggleFinished() { + var updatePayload = { + isFinished: !this.userIsFinished + } + this.isProcessingReadUpdate = true + this.$axios + .$patch(`/api/me/progress/${this.libraryItemId}`, updatePayload) + .then(() => { + this.isProcessingReadUpdate = false + }) + .catch((error) => { + console.error('Failed', error) + this.isProcessingReadUpdate = false + }) + }, }, mounted() { this.$eventBus.$on('new-local-library-item', this.newLocalLibraryItem)