mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-08-24 00:14:39 +00:00
Preserve webhook mentions in list API (#1118)
This commit is contained in:
parent
318849daa2
commit
5997fd81f3
2 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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"])
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue