From 3a3cd78caccad9a154b6b9c422a419bf2a905e32 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Mon, 11 May 2026 22:08:56 +0000 Subject: [PATCH] Only show communications that are 'new' or 'opened' --- db/query/public/communication.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/db/query/public/communication.go b/db/query/public/communication.go index e251feb1..7b424436 100644 --- a/db/query/public/communication.go +++ b/db/query/public/communication.go @@ -28,7 +28,12 @@ func CommunicationsFromOrganization(ctx context.Context, org_id int64) ([]model. statement := table.Communication.SELECT( table.Communication.AllColumns, ).FROM(table.Communication). - WHERE(table.Communication.OrganizationID.EQ(postgres.Int(org_id))). + WHERE( + table.Communication.OrganizationID.EQ(postgres.Int(org_id)).AND( + table.Communication.Status.EQ(postgres.NewEnumValue( + model.Communicationstatus_New.String())).OR( + table.Communication.Status.EQ(postgres.NewEnumValue( + model.Communicationstatus_Opened.String()))))). ORDER_BY(table.Communication.Created.DESC()) return db.ExecuteMany[model.Communication](ctx, statement) }