diff --git a/models/utils/common.go b/models/utils/common.go index 4d17ceb..2849fd6 100644 --- a/models/utils/common.go +++ b/models/utils/common.go @@ -125,7 +125,7 @@ func genericLoadAll[T DBObject](res *mgb.Cursor, code int, err error, onlyDraft return nil, 404, err } for _, r := range results { - fmt.Println(!r.VerifyAuth(a.GetRequest()), f(r), r.IsDrafted()) + 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 }