From ed787683f47b4afd500997801ef4906598e5c20f Mon Sep 17 00:00:00 2001 From: mr Date: Fri, 17 Jan 2025 13:19:20 +0100 Subject: [PATCH] light modification --- models/utils/common.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 }