SoftInstigate / angular-restheart

AngularJS client module for RESTHeart
8 stars 3 forks source link

missing embedded data on root and db resources #1

Closed ujibang closed 8 years ago

ujibang commented 8 years ago

looking at the code:

if (angular.isDefined(data._embedded['rh:doc'])) {
                        extractedData = data._embedded['rh:doc'];
                    } else if (angular.isDefined(data._embedded['rh:file'])) {
                        extractedData = data._embedded['rh:file'];
                    } else {
                        extractedData = [];
                    }

the embedded data in not actually included for root (that has embedded['rh:db']_ array) and db (that can have _embedded['rh:bucket'] and embedded['rh:coll']_ arrays)

ujibang commented 8 years ago

There is a problem with buckets and collection. A db can contain both collections and buckets. So you need to get the two arrays and merge them (for instance, using lodash) eventually.

Also the embedded resources of schema stores (URI /db/_schemas) are rh:schema

22Viig commented 8 years ago

Fixed with commit 1b759dfa22f20b5ebe2954b6b9bb16f6126ce216