Skip to content

Commit

Permalink
Merge 4628554 into b9b3342
Browse files Browse the repository at this point in the history
  • Loading branch information
victorhmp committed Feb 6, 2020
2 parents b9b3342 + 4628554 commit 14c7435
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Missing error handling logic for productSearch query.

## [2.51.0] - 2020-02-06
### Added
Expand Down
7 changes: 6 additions & 1 deletion react/ProductSummaryList.js
Expand Up @@ -61,7 +61,7 @@ const ProductSummaryList = ({
maxItems = 10,
withFacets = false,
}) => {
const { data } = useQuery(productSearchV2, {
const { data, loading, error } = useQuery(productSearchV2, {
ssr: true,
name: 'productList',
variables: {
Expand All @@ -80,6 +80,11 @@ const ProductSummaryList = ({
},
})

// TODO Improve this error handling in the future
if (loading || error) {
return null
}

const { list } = useListContext()
const { treePath } = useTreePath()

Expand Down
6 changes: 5 additions & 1 deletion store/interfaces.json
Expand Up @@ -86,6 +86,10 @@
"list-context.product-list": {
"allowed": ["product-summary"],
"composition": "children",
"component": "ProductSummaryList"
"component": "ProductSummaryList",
"preview": {
"type": "grid",
"height": 550
}
}
}

0 comments on commit 14c7435

Please sign in to comment.