Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Change translation from jp-JP to ja-JP - @gibkigonzo (#3824)
- Fixed ecosystem config for pm2 - @andrzejewsky (#3842)
- Fixed `mappingFallback` for extending modules - @andrzejewsky (#3822)
- Fixed adding products search results to category-next product store - @grimasod (#3877)
- Use `defaultSortBy` for sorting category products by default @haelbichalex (#3873)
- Fixed some potential mutations of Config object in `catalog` and `catalog-next` - @grimasod (#3843)

Expand Down
5 changes: 3 additions & 2 deletions core/modules/catalog-next/store/category/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import cloneDeep from 'lodash-es/cloneDeep'
const mutations: MutationTree<CategoryState> = {
[types.CATEGORY_SET_PRODUCTS] (state, products = []) {
nonReactiveState.products = cloneDeep(products)
state.products = cloneDeep(products).map(prod => prod.sku)
state.products = products.map(prod => prod.sku)
},
[types.CATEGORY_ADD_PRODUCTS] (state, products = []) {
state.products.push(...products)
nonReactiveState.products.push(...cloneDeep(products))
state.products.push(...products.map(prod => prod.sku))
},
[types.CATEGORY_ADD_CATEGORY] (state, category: Category) {
if (category) {
Expand Down