update views + reduced providers in main app
[outofuni/tavern2.git] / lib / product_category_service.dart
index f246a71..0d2830d 100644 (file)
@@ -35,9 +35,9 @@ class ProductCategoryService {
                }
        }
 
-       Future<Null> createProdCategory(String name) async {
+       Future<String> createProdCategory(String name) async {
                try {
-                       await _http.post(
+                       var res = await _http.post(
                                _posturl,
                                headers: {'Content-Type': 'application/json'},
                                body: JSON.encode({
@@ -45,6 +45,7 @@ class ProductCategoryService {
                                        'type': 'product_category'
                                })
                        );
+                       return(JSON.decode(res.body)['id']);
                }
                catch(e) {
                        throw _handleError(e);