angular + minor fixes

This commit is contained in:
Darko Luketic
2018-03-28 13:59:51 +02:00
parent 6761f8d666
commit 938a7e7789
33 changed files with 7886 additions and 3 deletions

View File

@ -209,9 +209,7 @@ func (r *DataRepository) List(p *DataParams) ([]*model.Data, error) {
func (r *DataRepository) Get(p *DataParams) (*model.Data, error) {
ms := r.ms.Copy()
defer ms.Close()
c := ms.DB(r.database).C(r.collection)
q := bson.M{}
// id
@ -289,7 +287,7 @@ func (r *DataRepository) Get(p *DataParams) (*model.Data, error) {
m := new(model.Data)
rq := c.Find(q)
if e := rq.All(m); e != nil {
if e := rq.One(m); e != nil {
return nil, e
}