}
}
- 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({
'type': 'product_category'
})
);
+ return(JSON.decode(res.body)['id']);
}
catch(e) {
throw _handleError(e);