mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
Latest Release (#187)
* Remove duplicated css rules. (#185) * Fix typo in the Marquee component (#176) Co-authored-by: Hugo Lopes <hugo.lopes@present-technologies.com> * Remove duplicated css rules. Fix invalid JSX props. Co-authored-by: Hugo Lopes <hugo.lopes@present-technologies.com> * Fix the body scroll when the sidebar is open (#184) * Fix typo in the Marquee component (#176) Co-authored-by: Hugo Lopes <hugo.lopes@present-technologies.com> * Fix the body scroll when the sidebar is open Co-authored-by: Hugo Lopes <hugo.lopes@present-technologies.com> * Remove duplicate class in the I18nWidget comp (#183) * Fix typo in the Marquee component (#176) Co-authored-by: Hugo Lopes <hugo.lopes@present-technologies.com> * Remove duplicate class name in the I18nWidget comp This PR removes a duplicate class name in the I18nWidget component. Co-authored-by: Hugo Lopes <hugo.rodrigues.lopes@gmail.com> Co-authored-by: Hugo Lopes <hugo.lopes@present-technologies.com> * add horizontal margin to pages when mobile screen (#180) * Add cart item options like color and size (#177) Co-authored-by: hlopes <hugo.lopes@present-technologies.com> * Changes Co-authored-by: Hugo Lopes <hugo.rodrigues.lopes@gmail.com> Co-authored-by: Hugo Lopes <hugo.lopes@present-technologies.com> Co-authored-by: Jamie Isaksen <jamie@jamie.no> Co-authored-by: Vinicius Zucatti <51221635+vczb@users.noreply.github.com>
This commit is contained in:
@@ -26,8 +26,8 @@ const addItem: CartHandlers['addItem'] = async ({
|
||||
}),
|
||||
}
|
||||
const { data } = cartId
|
||||
? await config.storeApiFetch(`/v3/carts/${cartId}/items`, options)
|
||||
: await config.storeApiFetch('/v3/carts', options)
|
||||
? await config.storeApiFetch(`/v3/carts/${cartId}/items?include=line_items.physical_items.options`, options)
|
||||
: await config.storeApiFetch('/v3/carts?include=line_items.physical_items.options', options)
|
||||
|
||||
// Create or update the cart cookie
|
||||
res.setHeader(
|
||||
|
@@ -12,7 +12,7 @@ const getCart: CartHandlers['getCart'] = async ({
|
||||
|
||||
if (cartId) {
|
||||
try {
|
||||
result = await config.storeApiFetch(`/v3/carts/${cartId}`)
|
||||
result = await config.storeApiFetch(`/v3/carts/${cartId}?include=line_items.physical_items.options`)
|
||||
} catch (error) {
|
||||
if (error instanceof BigcommerceApiError && error.status === 404) {
|
||||
// Remove the cookie if it exists but the cart wasn't found
|
||||
|
@@ -15,7 +15,7 @@ const removeItem: CartHandlers['removeItem'] = async ({
|
||||
}
|
||||
|
||||
const result = await config.storeApiFetch<{ data: any } | null>(
|
||||
`/v3/carts/${cartId}/items/${itemId}`,
|
||||
`/v3/carts/${cartId}/items/${itemId}?include=line_items.physical_items.options`,
|
||||
{ method: 'DELETE' }
|
||||
)
|
||||
const data = result?.data ?? null
|
||||
|
@@ -16,7 +16,7 @@ const updateItem: CartHandlers['updateItem'] = async ({
|
||||
}
|
||||
|
||||
const { data } = await config.storeApiFetch(
|
||||
`/v3/carts/${cartId}/items/${itemId}`,
|
||||
`/v3/carts/${cartId}/items/${itemId}?include=line_items.physical_items.options`,
|
||||
{
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({
|
||||
|
Reference in New Issue
Block a user