From 1a66c2d58b40f81db595b8125192730042fdc6b0 Mon Sep 17 00:00:00 2001 From: Zak Timson Date: Sat, 14 Jul 2018 19:59:54 -0400 Subject: [PATCH] Fixed creating root category item --- src/app/store/newCategory/newCategory.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()); } }