update views + reduced providers in main app
[outofuni/tavern2.git] / lib / product_category_component.dart
index b7d3bf1..70b1a93 100644 (file)
@@ -29,8 +29,13 @@ class ProductCategoryComponent implements OnInit {
        ProductCategoryComponent(this._prodcatSrv,this._router);
 
        Future<Null> createProductCategory() async {
        ProductCategoryComponent(this._prodcatSrv,this._router);
 
        Future<Null> createProductCategory() async {
-               await _prodcatSrv.createProdCategory(new_prod_category_name);
-               await ngOnInit();
+               String id = await _prodcatSrv.createProdCategory(
+                       new_prod_category_name
+               );
+               product_categories.add(new ProductCategory(
+                       id,new_prod_category_name,'product_cetegory'
+               ));
+               new_prod_category_name='';
        }
 
        Future<Null> ngOnInit() async {
        }
 
        Future<Null> ngOnInit() async {