From d44fb976e4ffc9c2afda31bfdb077e5c1801fd96 Mon Sep 17 00:00:00 2001 From: mr Date: Fri, 17 Jan 2025 11:05:08 +0100 Subject: [PATCH] inspect search bug --- models/utils/common.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }