Skip to content

Commit

Permalink
Merge branch 'develop' into PWA-3117
Browse files Browse the repository at this point in the history
  • Loading branch information
glo82145 committed Sep 27, 2023
2 parents 664b1ed + 297ba0d commit f6182cc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export const ADD_PRODUCT_TO_CART = gql`
...CartTriggerFragment
...MiniCartFragment
}
user_errors {
code
message
}
}
}
${CartTriggerFragment}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,11 @@ export const useProductFullDetail = props => {

const [
addProductToCart,
{ error: errorAddingProductToCart, loading: isAddProductLoading }
{
data: addToCartResponseData,
error: errorAddingProductToCart,
loading: isAddProductLoading
}
] = useMutation(operations.addProductToCartMutation);

const breadcrumbCategoryId = useMemo(
Expand Down Expand Up @@ -556,12 +560,14 @@ export const useProductFullDetail = props => {
deriveErrorMessage([
errorAddingSimpleProduct,
errorAddingConfigurableProduct,
errorAddingProductToCart
errorAddingProductToCart,
...(addToCartResponseData?.addProductsToCart?.user_errors || [])
]),
[
errorAddingConfigurableProduct,
errorAddingProductToCart,
errorAddingSimpleProduct
errorAddingSimpleProduct,
addToCartResponseData
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const ProductForm = props => {
}}
errors={Array.from(errors.values())}
scrollOnError={false}
allowErrorMessages={true}
/>
<ProductDetail
item={cartItem}
Expand Down

0 comments on commit f6182cc

Please sign in to comment.