Skip to content

Commit

Permalink
Remove sku specs with no values
Browse files Browse the repository at this point in the history
  • Loading branch information
thalytafabrine committed Mar 19, 2024
1 parent 667675e commit ca6efd8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Fixed
- Remove specifications with no values from `skuSpecifications`.

## [1.6.1] - 2024-03-18

### Fixed
Expand Down
4 changes: 4 additions & 0 deletions src/convertSearchDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ const skuSpecificationsFromDocuments = (
})

skuSpecs.forEach((specification) => {
if (!specification.SpecificationValues.length) {
return
}

groupedSpecs[specification.FieldId] = {
Name: specification.Name,
SpecificationValues: (groupedSpecs[specification.FieldId]?.SpecificationValues ?? []).concat(
Expand Down

0 comments on commit ca6efd8

Please sign in to comment.