Compare commits

...

2 Commits

Author SHA1 Message Date
Jaume Solís 9b3688f8fc productos relacionados 2024-04-16 19:41:17 +02:00
Jaume Solís 3e8e12f913 devolver el producto 2024-04-16 19:37:37 +02:00
2 changed files with 3 additions and 2 deletions

View File

@ -98,7 +98,7 @@ class ProductController {
const { dateExpired, postalCode } = req.query const { dateExpired, postalCode } = req.query
const id = Number(req.params.id) const id = Number(req.params.id)
const product = await db.getProductById(req.params.id); const product = await db.getProductById(req.params.id);
const filterProduct = (product[0][0] && product[0][0][0])?product[0][0][0]:{}; const filterProduct = (product[0][0] && product[0][0])?product[0][0]:{};
return res.status(200).send({ return res.status(200).send({
data: filterProduct data: filterProduct

View File

@ -336,7 +336,7 @@ export default defineComponent({
<Container cardContainer class="no-padding"> <Container cardContainer class="no-padding">
<template <template
v-for="( v-for="(
{ image, discount, isNew, name, price, id }, i { image, discount, isNew, name, price, id, postalCode }, i
) in products.data" ) in products.data"
:key="id" :key="id"
> >
@ -348,6 +348,7 @@ export default defineComponent({
:imgSrc="image" :imgSrc="image"
:isNew="isNew" :isNew="isNew"
:id="id" :id="id"
:hasPostalCode="(postalCode !== 'undefined')?true:false"
/> />
</template> </template>
</Container> </Container>