package adminapi import ( "net/http" "gitea.mynodes.xyz/ilker/llmgw/internal/notify" ) // SetNotifier gives the API the webhooks `ctl notify test` reaches. func (a *API) SetNotifier(n *notify.Notifier) { a.notifier = n } // notifyTest sends a test event to every webhook and says how each answered. func (a *API) notifyTest(w http.ResponseWriter, r *http.Request) { if a.notifier == nil { writeError(w, http.StatusNotFound, "no webhooks: server.yaml has no notify.webhooks") return } writeJSON(w, http.StatusOK, a.notifier.Test(r.Context())) }