From de2e92cf3e49d4044564a62e8d8fa972bf0d4bdf Mon Sep 17 00:00:00 2001 From: cond0r <1243434+cond0r@users.noreply.github.com> Date: Thu, 26 Jan 2023 10:35:43 +0200 Subject: [PATCH] Fix image height & missing query string --- packages/commerce/src/api/utils/index.ts | 5 ++++- site/components/product/ProductCard/ProductCard.module.css | 2 +- site/components/product/ProductView/ProductView.tsx | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/commerce/src/api/utils/index.ts b/packages/commerce/src/api/utils/index.ts index 3fd50d00e..bbc3cc340 100644 --- a/packages/commerce/src/api/utils/index.ts +++ b/packages/commerce/src/api/utils/index.ts @@ -44,7 +44,10 @@ export const transformRequest = (req: NextApiRequest, path: string) => { body = JSON.stringify(req.body) } - return new NextRequest(`https://${req.headers.host}/api/commerce/${path}`, { + // Get the url path & query string + const url = new URL(req.url || '/', `https://${req.headers.host}`) + + return new NextRequest(url, { headers, method: req.method, body, diff --git a/site/components/product/ProductCard/ProductCard.module.css b/site/components/product/ProductCard/ProductCard.module.css index fe92766ce..ab19f9557 100644 --- a/site/components/product/ProductCard/ProductCard.module.css +++ b/site/components/product/ProductCard/ProductCard.module.css @@ -73,7 +73,7 @@ } .imageContainer .productImage { - @apply transform transition-transform duration-500 object-cover w-auto h-full; + @apply transform transition-transform duration-500 object-cover; } .root .wishlistButton { diff --git a/site/components/product/ProductView/ProductView.tsx b/site/components/product/ProductView/ProductView.tsx index 0c81072ea..c73766acf 100644 --- a/site/components/product/ProductView/ProductView.tsx +++ b/site/components/product/ProductView/ProductView.tsx @@ -81,8 +81,6 @@ const ProductView: FC = ({ product, relatedProducts }) => { className="animated fadeIn" imgProps={{ alt: p.name, - width: 300, - height: 300, }} />