diff --git a/src/app/store/newCategory/newCategory.component.ts b/src/app/store/newCategory/newCategory.component.ts index fa58f15..dd033c7 100644 --- a/src/app/store/newCategory/newCategory.component.ts +++ b/src/app/store/newCategory/newCategory.component.ts @@ -29,7 +29,7 @@ export class NewCategoryComponent { if (!this.data) { this.db .collection('categories') - .add({name: this.name, parent: this.parent, image: this.image}) + .add({name: this.name, image: this.image, parent: this.parent == 'root' ? null : this.parent}) .then(data => this.dialogRef.close()); } }