develop #10
|
@ -98,7 +98,7 @@ class ProductController {
|
|||
const { dateExpired, postalCode } = req.query
|
||||
const id = Number(req.params.id)
|
||||
const _products = await db.getProducts(dateExpired, postalCode);
|
||||
const filterProduct = _products[0].filter(item => item.id === id)
|
||||
const filterProduct = _products[0].filter(item => item.itemFk === id)
|
||||
|
||||
return res.status(200).send({
|
||||
data: filterProduct
|
||||
|
|
|
@ -275,14 +275,14 @@ export default defineComponent({
|
|||
|
||||
<div class="products-section-body">
|
||||
<Container cardContainer class="category-container">
|
||||
<template v-for="item in products.data" :key="item?.id">
|
||||
<template v-for="item in products.data" :key="item?.itemFk">
|
||||
<Card
|
||||
v-if="item"
|
||||
:price="item.price"
|
||||
:title="item.name"
|
||||
:imgSrc="item.image"
|
||||
:isNew="item.isNew"
|
||||
:id="item.id"
|
||||
:id="item.itemFk"
|
||||
/>
|
||||
</template>
|
||||
</Container>
|
||||
|
|
|
@ -190,9 +190,9 @@ export default defineComponent({
|
|||
<p class="product-content-paragraph">
|
||||
SKU:
|
||||
<span class="green-text" style="display: inline-flex">
|
||||
{{ products.current?.id }}
|
||||
{{ products.current?.itemFk }}
|
||||
<q-skeleton
|
||||
v-if="!products.current?.id"
|
||||
v-if="!products.current?.itemFk"
|
||||
width="100px"
|
||||
type="text"
|
||||
/>
|
||||
|
@ -303,7 +303,7 @@ export default defineComponent({
|
|||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="products.next?.id"
|
||||
v-if="products.next?.itemFk"
|
||||
color="white"
|
||||
class="btn outlined rounded sm-btn product-pag-item product-next-btn"
|
||||
:to="`${+$route.params.id + 1}`"
|
||||
|
|
|
@ -197,7 +197,7 @@ export const useCartStore = defineStore("cart", () => {
|
|||
await getProducts(params);
|
||||
|
||||
const hasCurrentProduct = computed(() => {
|
||||
return cart.value.find((p) => p.id === product.id);
|
||||
return cart.value.find((p) => p.itemFk === product.itemFk);
|
||||
});
|
||||
|
||||
if (isEmpty.value) {
|
||||
|
@ -209,7 +209,7 @@ export const useCartStore = defineStore("cart", () => {
|
|||
});
|
||||
}
|
||||
|
||||
if (!products.value.data.some((item) => item.id === product.id)) {
|
||||
if (!products.value.data.some((item) => item.itemFk === product.itemFk)) {
|
||||
push("/");
|
||||
return quasarNotify({
|
||||
message:
|
||||
|
|
Loading…
Reference in New Issue