From 5997fd81f3ff795150ebd48d4b123714fe738c3f Mon Sep 17 00:00:00 2001 From: rcourtman Date: Wed, 25 Mar 2026 23:12:22 +0000 Subject: [PATCH] Preserve webhook mentions in list API (#1118) --- internal/api/notifications.go | 4 ++++ internal/api/notifications_test.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/internal/api/notifications.go b/internal/api/notifications.go index 04ed7a7f5..cc9d1ebc0 100644 --- a/internal/api/notifications.go +++ b/internal/api/notifications.go @@ -249,6 +249,10 @@ func (h *NotificationHandlers) GetWebhooks(w http.ResponseWriter, r *http.Reques whMap["template"] = webhook.Template } + if webhook.Mention != "" { + whMap["mention"] = webhook.Mention + } + maskedWebhooks[i] = whMap } diff --git a/internal/api/notifications_test.go b/internal/api/notifications_test.go index 9199321a4..2ab9ea664 100644 --- a/internal/api/notifications_test.go +++ b/internal/api/notifications_test.go @@ -358,6 +358,7 @@ func TestNotificationHandlers(t *testing.T) { Name: "Test Webhook", URL: "https://example.com", Headers: map[string]string{"Authorization": "Bearer token"}, + Mention: "@everyone", }, } mockManager.On("GetWebhooks").Return(webhooks).Once() @@ -371,6 +372,7 @@ func TestNotificationHandlers(t *testing.T) { json.Unmarshal(w.Body.Bytes(), &resp) assert.Equal(t, 1, len(resp)) assert.Equal(t, "wh1", resp[0]["id"]) + assert.Equal(t, "@everyone", resp[0]["mention"]) headers := resp[0]["headers"].(map[string]interface{}) assert.Equal(t, "***REDACTED***", headers["Authorization"]) })