Preserve webhook mentions in list API (#1118)

This commit is contained in:
rcourtman 2026-03-25 23:12:22 +00:00
parent 318849daa2
commit 5997fd81f3
2 changed files with 6 additions and 0 deletions

View file

@ -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
}

View file

@ -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"])
})