mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-10 03:11:34 +00:00
added star rating to comments
This commit is contained in:
parent
396ecfff4a
commit
5fe3fd7f76
5 changed files with 210 additions and 72 deletions
|
|
@ -1242,6 +1242,7 @@ class LibraryItemController {
|
|||
try {
|
||||
const comment = await Database.commentModel.create({
|
||||
text: req.body.text,
|
||||
rating: req.body.rating,
|
||||
libraryItemId: req.params.id,
|
||||
userId: req.user.id
|
||||
})
|
||||
|
|
@ -1287,7 +1288,10 @@ class LibraryItemController {
|
|||
return res.status(403).json({ error: 'Not authorized to update this comment' })
|
||||
}
|
||||
|
||||
await comment.update({ text: req.body.text })
|
||||
await comment.update({
|
||||
text: req.body.text,
|
||||
rating: req.body.rating
|
||||
})
|
||||
res.json(comment)
|
||||
} catch (error) {
|
||||
Logger.error('[LibraryItemController] updateComment error:', error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue