mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-09 19:01:41 +00:00
fixed edit
This commit is contained in:
parent
5fe3fd7f76
commit
c5ddede56e
1 changed files with 3 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue