Skip to content

Commit

Permalink
Remove empty spec groups
Browse files Browse the repository at this point in the history
  • Loading branch information
thalytafabrine committed Jul 31, 2023
1 parent de7d347 commit fbf6eb5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/convertSearchDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ const specificationsInfoFromDocument = (SpecificationGroups: SkuDocumentSpecific
(specification) => specification.SpecificationValues.filter((spec) => spec.Value).length
)

if (!specs.length) {
return
}

allSpecificationsGroups.push(group.GroupName)
specs.forEach(({ Name, Position, IsOnProductDetails, FieldId, SpecificationValues }) => {
specificationsInfo[Name] = SpecificationValues.map((value) => value.Value)
Expand Down

0 comments on commit fbf6eb5

Please sign in to comment.