Skip to content

Commit fe1be66

Browse files
authored
Merge pull request #3858 from andrzejewsky/fixDuplicateKeys
Fix duplicate keys errors
2 parents e1126df + 76542f0 commit fe1be66

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

src/themes/default/components/core/blocks/Checkout/ThankYouPage.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<div class="container">
55
<breadcrumbs
66
:with-homepage="true"
7-
:routes="[{name: 'Homepage', route_link: '/'}]"
87
:active-route="this.$t('Order confirmation')"
98
/>
109
<h2 class="category-title">

src/themes/default/components/core/blocks/SearchPanel/SearchPanel.vue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,17 @@ export default {
112112
return productList
113113
},
114114
categories () {
115-
const categoriesMap = {}
116-
this.products.forEach(product => {
117-
[...product.category].forEach(category => {
118-
categoriesMap[category.category_id] = category
119-
})
120-
})
121-
return Object.keys(categoriesMap).map(categoryId => categoriesMap[categoryId])
115+
const categories = this.products
116+
.filter(p => p.category)
117+
.map(p => p.category)
118+
.flat()
119+
.filter(c => c.name)
120+
121+
const discinctCategories = Array.from(
122+
new Set(categories.map(c => c.category_id))
123+
).map(catId => categories.find(c => c.category_id === catId))
124+
125+
return discinctCategories
122126
},
123127
getNoResultsMessage () {
124128
let msg = ''

src/themes/default/pages/Compare.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="compare">
33
<div class="bg-cl-secondary py35 pl20">
44
<div class="container">
5-
<breadcrumbs :with-homepage="true" :routes="[{name: 'Homepage', route_link: '/'}]" active-route="Compare" />
5+
<breadcrumbs :with-homepage="true" active-route="Compare" />
66
<h2>{{ title }}</h2>
77
</div>
88
</div>

0 commit comments

Comments
 (0)