From c5ddede56e5032877872db11166a9f8a549e81a9 Mon Sep 17 00:00:00 2001 From: zipben Date: Wed, 4 Jun 2025 14:09:25 +0000 Subject: [PATCH] fixed edit --- client/pages/item/_id/index.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/pages/item/_id/index.vue b/client/pages/item/_id/index.vue index 27694536a..5878740d7 100644 --- a/client/pages/item/_id/index.vue +++ b/client/pages/item/_id/index.vue @@ -944,16 +944,17 @@ export default { }, async saveEdit(comment) { try { - const response = await this.$axios.put(`/api/items/${this.libraryItem.id}/comments/${comment.id}`, { + const response = await this.$axios.$patch(`/api/items/${this.libraryItemId}/comments/${comment.id}`, { text: this.editCommentText.trim(), rating: this.editRating || null }) const index = this.comments.findIndex((c) => c.id === comment.id) - this.comments.splice(index, 1, response.data) + this.comments.splice(index, 1, response) this.cancelEdit() this.$toast.success(this.$strings.MessageCommentUpdated) } catch (error) { + console.error('Error updating comment:', error) this.$toast.error(this.$strings.ErrorUpdatingComment) } },