The Admin Moderation API provides three endpoints for managing reviews that have been flagged by users. Administrators can inspect reported content, restore reviews that were incorrectly flagged, or permanently remove content that violates community standards.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JuseAR27/Unisierra-eats/llms.txt
Use this file to discover all available pages before exploring further.
GET /api/admin/resenas-reportadas
Returns all reviews whoseestado is 'reportada', ordered from most recent to oldest. The query joins both Usuarios and Productos tables so the response includes the reviewer’s name and the product name alongside each reported review.
SQL Query
The endpoint executes the following query internally:Request
No request body or query parameters are required.Response — 200 OK
Returns a JSON array. Each element has the following fields:Unique identifier of the reported review.
Text body of the flagged review.
Timestamp of when the review was originally created.
Star rating of the flagged review (1–5).
Display name of the user who wrote the review, joined from
Usuarios.Name of the product the review was written for, joined from
Productos.Response — 500 Internal Server Error
Example
PUT /api/admin/resenas/:id/aprobar
Restores a reported review to active public status by setting itsestado back to 'activa'. After this call, the review reappears in GET /api/resenas/usuario/:usuario_id and GET /api/resenas/producto/:producto_id responses and is counted in the product’s average rating.
Path Parameter
| Parameter | Type | Description |
|---|---|---|
id | integer | The id of the reported review to restore. |
Request Body
None required.Response — 200 OK
Confirmation message:
"Reseña restaurada.".Response — 500 Internal Server Error
Example
DELETE /api/admin/resenas/:id
Permanently deletes a single review from the database. This endpoint is intended for admin moderation — removing content that violates community guidelines after it has been reviewed. The action is irreversible.DELETE /api/admin/resenas/:id and DELETE /api/resenas/:id both execute DELETE FROM Resenas WHERE id = ? and return different but equivalent success messages. The distinction is semantic: the admin endpoint is the moderation pathway for content that has been reported and reviewed; the user endpoint is for a user self-deleting their own review. Neither endpoint cascades to other tables.Path Parameter
| Parameter | Type | Description |
|---|---|---|
id | integer | The id of the review to permanently delete. |
Request Body
None required.Response — 200 OK
Confirmation message:
"Reseña eliminada permanentemente.".