The product store is the main customer-facing catalog for Ecommerce Delivery. Any visitor with a valid session can scroll through available products, filter by name or shirt type, and open a detailed product modal. Admin users (roleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/ecommerce-delivery-frontend/llms.txt
Use this file to discover all available pages before exploring further.
2) additionally see an Agregar button that opens the FormProducts dialog to create or edit catalog entries.
Route & components
The route/Store (also registered as posts) renders pages/store/MainStore.vue. That page composes three child components:
| Component | Responsibility |
|---|---|
BarFilterProducts | Debounced text search input; accepts getProductsByType callback for category filtering |
ProductCard | Card tile for each product in the grid and inside the detail modal |
FormProducts | Create / edit form submitted to the REST API |
Browsing products
Products load through aq-infinite-scroll component. Each scroll event calls listProducts(index, done), which increments the page counter and fires the following fetch:
{ status, listPrd: [...], pagination: { pags } }. When pagination.pags === pagination.pag (no more pages), done() is called and scrolling stops.
Filtering
By name
BarFilterProducts watches its query ref with a 400 ms debounce and calls getDataFilter(query) in the parent:
By category (shirt type)
When a type is selected,getProductsByType(typeValue) is called:
Resetting the filter
When the search input is cleared,getDataFilter receives an empty string and falls back to resetListProducts(), which resets pagination.pag to 1, clears the products array, and re-fetches from the first page.
Product detail modal
Clicking aProductCard tile calls showModalProduct(product), which fetches full product data by ID and opens a q-dialog:
oneProduct is populated and detailmodal is set to true. Inside the dialog, ProductCard is rendered with fulldescription: true and details: true, which expands the description, color swatches, available sizes, and stock count.
Admin: adding a product
The Agregar button is conditionally rendered only for admin users:q-dialog containing FormProducts. On submit, the form builds a FormData object and posts to POST /api/product/create:
Form fields
| Field | Type | Notes |
|---|---|---|
title | text | Product name |
description | textarea | Full product description |
price | number | Price in COP |
minCant | number | Available stock |
colorsSize | multi-select | JSON-serialised array of { label, value } |
sizes | multi-select | JSON-serialised array of { label } |
typeShirt | select | Single label string |
productImg | file (multiple) | multipart/form-data field, image/* |
Available colors (24 options)
Available sizes
Shirt types
Admin: editing a product
The sameFormProducts component is reused for editing. The parent passes the selected product as the oneProduct prop, which pre-populates all fields via onMounted:
props.oneProduct._id and posts to POST /api/product/update/:id instead of the create endpoint.
Discount field (edit mode only)
The discount input is rendered only whenoneProduct is present:
priceDiscount is a computed property:
Preserving existing images
If no new image files are selected during an edit, the existing images are sent back as JSON so the server keeps them:Authorization header for admin actions
All create and update requests include aBearer token in the Authorization header:
sessionUser is obtained from validateUser({ rol: 2 }), which reads the stored session and verifies the user has the admin role. If validation fails, the request is blocked and the user is notified.