From 114dbd24bcd68f992fb8ec35d92768c359c52424 Mon Sep 17 00:00:00 2001 From: benonymity Date: Sat, 23 Apr 2022 00:27:03 -0400 Subject: [PATCH] Add button to mark book as read --- pages/item/_id.vue | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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)