Browse Source

fix(core): Fix bug in importing Facets

Would duplicate Facets with slugs containing multiple words
Michael Bromley 3 years ago
parent
commit
84ce87f72a
1 changed files with 4 additions and 1 deletions
  1. 4 1
      packages/core/src/data-import/providers/importer/importer.ts

+ 4 - 1
packages/core/src/data-import/providers/importer/importer.ts

@@ -313,7 +313,10 @@ export class Importer {
             if (cachedFacet) {
             if (cachedFacet) {
                 facetEntity = cachedFacet;
                 facetEntity = cachedFacet;
             } else {
             } else {
-                const existing = await this.facetService.findByCode(normalizeString(facetName), languageCode);
+                const existing = await this.facetService.findByCode(
+                    normalizeString(facetName, '-'),
+                    languageCode,
+                );
                 if (existing) {
                 if (existing) {
                     facetEntity = existing;
                     facetEntity = existing;
                 } else {
                 } else {