light modification
This commit is contained in:
parent
d44fb976e4
commit
ed787683f4
@ -124,13 +124,15 @@ func genericLoadAll[T DBObject](res *mgb.Cursor, code int, err error, onlyDraft
|
|||||||
if err = res.All(mongo.MngoCtx, &results); err != nil {
|
if err = res.All(mongo.MngoCtx, &results); err != nil {
|
||||||
return nil, 404, err
|
return nil, 404, err
|
||||||
}
|
}
|
||||||
|
fmt.Println("results", results)
|
||||||
for _, r := range results {
|
for _, r := range results {
|
||||||
fmt.Println(!r.VerifyAuth(a.GetRequest()), f(r), (onlyDraft && !r.IsDrafted()) || (!onlyDraft && r.IsDrafted()), onlyDraft && !r.IsDrafted(), !onlyDraft && r.IsDrafted())
|
|
||||||
if !r.VerifyAuth(a.GetRequest()) || f(r) == nil || (onlyDraft && !r.IsDrafted()) || (!onlyDraft && r.IsDrafted()) {
|
if !r.VerifyAuth(a.GetRequest()) || f(r) == nil || (onlyDraft && !r.IsDrafted()) || (!onlyDraft && r.IsDrafted()) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
fmt.Println(!r.VerifyAuth(a.GetRequest()), f(r) == nil, (onlyDraft && !r.IsDrafted()) || (!onlyDraft && r.IsDrafted()), onlyDraft && !r.IsDrafted(), !onlyDraft && r.IsDrafted())
|
||||||
objs = append(objs, f(r))
|
objs = append(objs, f(r))
|
||||||
}
|
}
|
||||||
|
fmt.Println("results 2", results, objs)
|
||||||
return objs, 200, nil
|
return objs, 200, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user