From e9f65fadbfcf319db1f2f73e0984acad4f9aa505 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Thu, 5 Oct 2023 10:35:30 +0700 Subject: error query params --- src/core/components/elements/Product/cartProductsList.jsx | 1 + src/pages/api/shop/product-detail.js | 2 +- src/pages/shop/product/[slug].jsx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/components/elements/Product/cartProductsList.jsx b/src/core/components/elements/Product/cartProductsList.jsx index 7a95f1f1..5887b425 100644 --- a/src/core/components/elements/Product/cartProductsList.jsx +++ b/src/core/components/elements/Product/cartProductsList.jsx @@ -15,6 +15,7 @@ const CardProdcuctsList = ({ updateQuantity = () => {}, setDeleteConfirmation = () => {} }) => { + return ( diff --git a/src/pages/api/shop/product-detail.js b/src/pages/api/shop/product-detail.js index e77ae53a..8571b623 100644 --- a/src/pages/api/shop/product-detail.js +++ b/src/pages/api/shop/product-detail.js @@ -10,7 +10,7 @@ export default async function handler(req, res) { process.env.SOLR_HOST + `/solr/variants/select?q=template_id_i:${req.query.id}&q.op=OR&indent=true&rows=100` ) - let auth = req.query.auth + let auth = JSON.parse(req.query.auth) let result = productMappingSolr(productTemplate.data.response.docs, auth || false) result[0].variants = variantsMappingSolr( productTemplate.data.response.docs[0], diff --git a/src/pages/shop/product/[slug].jsx b/src/pages/shop/product/[slug].jsx index 7351da2f..63fb2e7e 100644 --- a/src/pages/shop/product/[slug].jsx +++ b/src/pages/shop/product/[slug].jsx @@ -18,7 +18,7 @@ export async function getServerSideProps(context) { const cookies = context.req.headers.cookie const cookieObj = cookies ? cookie.parse(cookies) : {} const auth = cookieObj.auth ? JSON.parse(cookieObj.auth) : {} - const tier = auth.pricelist + const tier = auth.pricelist ? auth.pricelist : false const authToken = auth?.token || '' let response = await axios( -- cgit v1.2.3