diff --git a/packages/commerce/src/api/utils/index.ts b/packages/commerce/src/api/utils/index.ts index 3fd50d00e..fe222e39b 100644 --- a/packages/commerce/src/api/utils/index.ts +++ b/packages/commerce/src/api/utils/index.ts @@ -28,7 +28,7 @@ export const getInput = (req: NextRequest) => req.json().catch(() => ({})) * @param req NextApiRequest * @param path string */ -export const transformRequest = (req: NextApiRequest, path: string) => { +export const transformRequest = (req: NextApiRequest) => { const headers = new Headers() let body @@ -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/packages/commerce/src/api/utils/node-handler.ts b/packages/commerce/src/api/utils/node-handler.ts index b08af9b0a..158142d18 100644 --- a/packages/commerce/src/api/utils/node-handler.ts +++ b/packages/commerce/src/api/utils/node-handler.ts @@ -44,7 +44,7 @@ export default function nodeHandler

( ) } - const output = await handlers[path](transformRequest(req, path)) + const output = await handlers[path](transformRequest(req)) const { status, errors, data, redirectTo, headers } = output setHeaders(res, headers) 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..57aae4171 100644 --- a/site/components/product/ProductView/ProductView.tsx +++ b/site/components/product/ProductView/ProductView.tsx @@ -69,10 +69,7 @@ const ProductView: FC = ({ product, relatedProducts }) => { Related Products

{relatedProducts.map((p) => ( -
+
= ({ product, relatedProducts }) => { className="animated fadeIn" imgProps={{ alt: p.name, - width: 300, - height: 300, + className: 'w-full h-full object-cover', }} />
diff --git a/site/pages/index.tsx b/site/pages/index.tsx index 64b8f4d09..8f7d8d1e2 100644 --- a/site/pages/index.tsx +++ b/site/pages/index.tsx @@ -70,8 +70,8 @@ export default function Home({ product={product} imgProps={{ alt: product.name, - width: i === 0 ? 1080 : 540, - height: i === 0 ? 1080 : 540, + width: i === 1 ? 1080 : 540, + height: i === 1 ? 1080 : 540, }} /> ))}