From 27596aff20b35b077256864cd431e5445e785b0f Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Mon, 11 May 2026 22:00:17 +0000 Subject: [PATCH] Fix insertion of communication log entries when marking --- db/query/public/communication_log_entry.go | 4 ++-- resource/communication.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/db/query/public/communication_log_entry.go b/db/query/public/communication_log_entry.go index 0eca6372..4ec5b685 100644 --- a/db/query/public/communication_log_entry.go +++ b/db/query/public/communication_log_entry.go @@ -12,8 +12,8 @@ import ( func CommunicationLogEntryInsert(ctx context.Context, txn db.Tx, m model.CommunicationLogEntry) (model.CommunicationLogEntry, error) { m.Created = time.Now() - statement := table.Communication.INSERT(table.Communication.MutableColumns). + statement := table.CommunicationLogEntry.INSERT(table.CommunicationLogEntry.MutableColumns). MODEL(m). - RETURNING(table.Communication.AllColumns) + RETURNING(table.CommunicationLogEntry.AllColumns) return db.ExecuteOne[model.CommunicationLogEntry](ctx, statement) } diff --git a/resource/communication.go b/resource/communication.go index 6d18e093..a75d764b 100644 --- a/resource/communication.go +++ b/resource/communication.go @@ -191,6 +191,10 @@ func (res *communicationR) markCommunication(ctx context.Context, r *http.Reques public_report = public_reports[0] } + err = m(ctx, user, int32(comm_id)) + if err != nil { + return communication{}, nhttp.NewError("failed to mark %d: %w", comm_id, err) + } log.Info().Int("communication", comm_id).Str("status", status).Msg("Marked communication") return res.hydrateCommunication(*result, &public_report) }