Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit 9e50017

Browse files
author
tkostuch
committed
3948 remove buckets, because we still have aggregations
1 parent 0be0f70 commit 9e50017

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

src/api/attribute/service.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ function transformToMetadata ({
137137
is_comparable,
138138
attribute_code,
139139
slug,
140-
options = [],
141-
buckets = []
140+
options = []
142141
}) {
143142
return {
144143
is_visible_on_front,
@@ -151,8 +150,7 @@ function transformToMetadata ({
151150
is_comparable,
152151
attribute_code,
153152
slug,
154-
options,
155-
buckets
153+
options
156154
}
157155
}
158156

src/api/catalog.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,6 @@ async function getProductsAttributesMetadata (body, config, indexName: string):
4747
// find attribute list
4848
const attributeList: any[] = await AttributeService.list(attributeListParam, config, indexName)
4949

50-
// add buckets for range attributes
51-
Object.keys(body.aggregations)
52-
.filter(key => key.match(/^(agg_range_)/g))
53-
.forEach(key => {
54-
const attributeCode = key.replace(/^(agg_range_)/g, '')
55-
const buckets = body.aggregations[key].buckets
56-
const attribute = attributeList.find(attr => attr.attribute_code === attributeCode)
57-
if (attribute) {
58-
attribute.buckets = buckets
59-
}
60-
})
61-
6250
return attributeList
6351
}
6452

0 commit comments

Comments
 (0)