Add review deletion functionality and UI enhancements

- Implemented delete functionality for reviews in both the ReviewModal and ReviewsTable components.
- Added confirmation prompts for review deletion actions.
- Updated ReviewController to allow deletion of reviews by admins or the review owner.
- Enhanced event handling to refresh the review list upon deletion.
- Improved UI to include delete buttons for admins in the ratings page and reviews table.
This commit is contained in:
fannta1990 2026-02-09 22:31:44 +08:00
parent d2285d952a
commit 633bc4805e
5 changed files with 106 additions and 5 deletions

View file

@ -132,6 +132,7 @@ class ApiRouter {
this.router.get('/items/:id/reviews', ReviewController.middleware.bind(this), ReviewController.findAllForItem.bind(this))
this.router.post('/items/:id/review', ReviewController.middleware.bind(this), ReviewController.createUpdate.bind(this))
this.router.delete('/items/:id/review', ReviewController.middleware.bind(this), ReviewController.delete.bind(this))
this.router.delete('/reviews/:id', ReviewController.deleteById.bind(this))
//
// User Routes