mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-09 10:51:37 +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) {
|
async saveEdit(comment) {
|
||||||
try {
|
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(),
|
text: this.editCommentText.trim(),
|
||||||
rating: this.editRating || null
|
rating: this.editRating || null
|
||||||
})
|
})
|
||||||
|
|
||||||
const index = this.comments.findIndex((c) => c.id === comment.id)
|
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.cancelEdit()
|
||||||
this.$toast.success(this.$strings.MessageCommentUpdated)
|
this.$toast.success(this.$strings.MessageCommentUpdated)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.error('Error updating comment:', error)
|
||||||
this.$toast.error(this.$strings.ErrorUpdatingComment)
|
this.$toast.error(this.$strings.ErrorUpdatingComment)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue