diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2022-11-03 17:30:14 +0700 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2022-11-03 17:30:14 +0700 |
| commit | e4b035a1471bd70872bb12012442367933fc8852 (patch) | |
| tree | 0466543b08aed29e3e3e4b3eeb52ca5d25c76922 /src/pages/shop | |
| parent | c1d6b160c7356f990017a36ccd84590c45e7528e (diff) | |
Show banner and brand in home
Diffstat (limited to 'src/pages/shop')
| -rw-r--r-- | src/pages/shop/product/[slug].js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pages/shop/product/[slug].js b/src/pages/shop/product/[slug].js index efc0be01..f50d5037 100644 --- a/src/pages/shop/product/[slug].js +++ b/src/pages/shop/product/[slug].js @@ -9,14 +9,16 @@ import currencyFormat from "../../../helpers/currencyFormat"; import Head from "next/head"; import { Swiper, SwiperSlide } from "swiper/react"; import { LazyLoadImage } from "react-lazy-load-image-component"; +import ImagePlaceholderIcon from "../../../icons/image-placeholder.svg"; import "swiper/css"; import "react-lazy-load-image-component/src/effects/blur.css"; -import ImagePlaceholderIcon from "../../../icons/image-placeholder.svg"; export async function getServerSideProps(context) { const { slug } = context.query; let product = await getOdoo('/api/v1/product/' + getId(slug)); - product = product[0]; + if (product.length == 1) { + product = product[0]; + } return {props: {product}}; } |
