test
This commit is contained in:
@@ -213,10 +213,10 @@ func genericLoadAll[T DBObject](res *mgb.Cursor, code int, err error, f func(DBO
|
||||
return nil, 404, err
|
||||
}
|
||||
for _, r := range results {
|
||||
fmt.Println("results", r.VerifyAuth(a.GetPeerID(), a.GetGroups()))
|
||||
if !r.VerifyAuth(a.GetPeerID(), a.GetGroups()) {
|
||||
continue
|
||||
}
|
||||
fmt.Println("results", len(results), f(r))
|
||||
objs = append(objs, f(r))
|
||||
}
|
||||
return objs, 200, nil
|
||||
@@ -224,6 +224,7 @@ func genericLoadAll[T DBObject](res *mgb.Cursor, code int, err error, f func(DBO
|
||||
|
||||
func GenericLoadAll[T DBObject](f func(DBObject) ShallowDBObject, wfa Accessor) ([]ShallowDBObject, int, error) {
|
||||
res_mongo, code, err := mongo.MONGOService.LoadAll(wfa.GetType().String())
|
||||
fmt.Println("res_mongo", res_mongo)
|
||||
return genericLoadAll[T](res_mongo, code, err, f, wfa)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user