diff --git a/models/utils/common.go b/models/utils/common.go index 2849fd6..ab874f5 100644 --- a/models/utils/common.go +++ b/models/utils/common.go @@ -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 { return nil, 404, err } + fmt.Println("results", 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()) { 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)) } + fmt.Println("results 2", results, objs) return objs, 200, nil }