HealtyHelp allows users to attach a single image to each recipe review. Images are stored on Cloudinary and go through an admin approval queue before becoming visible to other users.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanSebasSV/healtyhelp/llms.txt
Use this file to discover all available pages before exploring further.
Image Approval Workflow
Image States
| State | Value | Visibility |
|---|---|---|
| Pending review | "pendiente" | Visible only to the uploading user (as a “pending” notice) |
| Approved | "aprobada" | Visible to all users |
| Rejected | "rechazada" | Image deleted from Cloudinary; no longer visible to anyone |
Recipe.resenas[].imagen and stored in Cloudinary under the healtyhelp/resenas folder with dimensions up to 1200×1200 px and automatic quality optimization.
List Review Images
| Parameter | Default | Description |
|---|---|---|
estado | "pendiente" | Filter by state: pendiente, aprobada, or rechazada |
page | 1 | Page number |
limit | 12 | Items per page |
ImagenesAprobacion component (client/src/components/admin/ImagenesAprobacion.jsx) loads all three states in parallel on mount, caches them in a useRef, and switches between tabs instantly without additional network requests.
Approve an Image
Setsimagen.estado to "aprobada". The image URL remains intact on Cloudinary.
Reject an Image
Callscloudinary.uploader.destroy(publicId) to permanently delete the file, then clears url and publicId from the document and sets estado to "rechazada".
destroy() call fails (e.g. the image was already deleted), the error is logged but does not block the state update — the document is still updated to rechazada.
Delete an Image Record
Removes the entireimagen sub-document from the review. Only records in "aprobada" or "rechazada" state can be deleted this way; "pendiente" images must be approved or rejected first.
cloudinary.uploader.destroy() if a publicId is still present.
Bulk Delete Image Records
Promise.allSettled — failures in one item do not abort the others.
"pendiente" state are skipped (counted as fail) — you must approve or reject them before they can be bulk-deleted.
Cloudinary Integration
Images are uploaded via theuploadResena multer middleware defined in server/config/cloudinary.js:
secure_url (stored as imagen.url) and a public_id (stored as imagen.publicId). The publicId is the value passed to cloudinary.uploader.destroy() during rejection or deletion.
Required environment variables:
Dashboard Component Features
TheImagenesAprobacion component supports:
- Tabbed filter — switch between Pendientes / Aprobadas / Rechazadas with live counters.
- Badge polling — the parent
Dashboardpolls pending count every 60 seconds and shows a badge on the Imágenes tab. - Full-size image modal — click any image card to preview it at full size with approve/reject actions inline.
- Multi-select mode — select multiple cards for batch approve, reject, or history deletion.
- Ban user from image context — a “Ban user” button is available on rejected image cards, opening the ban modal pre-filled with the user’s name and the review context.