Browse Source

fix(admin-ui): Do not add empty option groups to a product

Relates to #1577
Michael Bromley 3 years ago
parent
commit
a39bf70b99

+ 1 - 0
packages/admin-ui/src/lib/catalog/src/components/product-variants-editor/product-variants-editor.component.ts

@@ -194,6 +194,7 @@ export class ProductVariantsEditorComponent implements OnInit, DeactivateAware {
     }
     }
 
 
     save() {
     save() {
+        this.optionGroups = this.optionGroups.filter(g => g.values.length);
         const newOptionGroups = this.optionGroups
         const newOptionGroups = this.optionGroups
             .filter(og => og.isNew)
             .filter(og => og.isNew)
             .map(og => ({
             .map(og => ({