diff --git a/client/pages/item/_id/index.vue b/client/pages/item/_id/index.vue index 4964009f..7b744938 100644 --- a/client/pages/item/_id/index.vue +++ b/client/pages/item/_id/index.vue @@ -602,10 +602,11 @@ export default { } }, clearProgressClick() { + if (!this.userMediaProgress) return if (confirm(`Are you sure you want to reset your progress?`)) { this.resettingProgress = true this.$axios - .$delete(`/api/me/progress/${this.libraryItemId}`) + .$delete(`/api/me/progress/${this.userMediaProgress.id}`) .then(() => { console.log('Progress reset complete') this.$toast.success(`Your progress was reset`) diff --git a/server/controllers/MeController.js b/server/controllers/MeController.js index 1cb2ec9a..7b8d4348 100644 --- a/server/controllers/MeController.js +++ b/server/controllers/MeController.js @@ -48,8 +48,7 @@ class MeController { // DELETE: api/me/progress/:id async removeMediaProgress(req, res) { - var wasRemoved = req.user.removeMediaProgress(req.params.id) - if (!wasRemoved) { + if (!req.user.removeMediaProgress(req.params.id)) { return res.sendStatus(200) } await this.db.updateEntity('user', req.user)