angular + minor fixes
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user