From 1a67a0e30adf61e30981a7f5ad2b23f0037642df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Bouzour=C3=A8ne?= Date: Thu, 23 Jan 2025 15:44:00 +0100 Subject: [PATCH] Contacts + Members: only show sections if they can contain --- controllers/contacts.go | 4 +++- controllers/members.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/controllers/contacts.go b/controllers/contacts.go index 4fb8090..b1b01ec 100644 --- a/controllers/contacts.go +++ b/controllers/contacts.go @@ -155,7 +155,9 @@ func Contacts(c *fiber.Ctx) error { db.Order( "name collate nocase asc", ).Find( - §ions, sqlFilterSections, + §ions, + "contains_contacts = ? AND id IN ?", + true, sqlFilterSections, ) return c.Render("people", fiber.Map{ diff --git a/controllers/members.go b/controllers/members.go index 33b8d94..226ca90 100644 --- a/controllers/members.go +++ b/controllers/members.go @@ -168,7 +168,9 @@ func Members(c *fiber.Ctx) error { db.Order( "name collate nocase asc", ).Find( - §ions, sqlFilterSections, + §ions, + "contains_members = ? AND id IN ?", + true, sqlFilterSections, ) return c.Render("people", fiber.Map{