@Summary Get notification dispatch methods @ID get-notification-dispatch-methods @Security CoderSessionToken @Produce json @Tags Notifications @Success 200 {array} codersdk.NotificationMethodsResponse @Router /api/v2/notifications/dispatch-methods [get]
(rw http.ResponseWriter, r *http.Request)
| 174 | // @Success 200 {array} codersdk.NotificationMethodsResponse |
| 175 | // @Router /api/v2/notifications/dispatch-methods [get] |
| 176 | func (api *API) notificationDispatchMethods(rw http.ResponseWriter, r *http.Request) { |
| 177 | var methods []string |
| 178 | for _, nm := range database.AllNotificationMethodValues() { |
| 179 | // Skip inbox method as for now this is an implicit delivery target and should not appear |
| 180 | // anywhere in the Web UI. |
| 181 | if nm == database.NotificationMethodInbox { |
| 182 | continue |
| 183 | } |
| 184 | methods = append(methods, string(nm)) |
| 185 | } |
| 186 | |
| 187 | httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.NotificationMethodsResponse{ |
| 188 | AvailableNotificationMethods: methods, |
| 189 | DefaultNotificationMethod: api.DeploymentValues.Notifications.Method.Value(), |
| 190 | }) |
| 191 | } |
| 192 | |
| 193 | // @Summary Send a test notification |
| 194 | // @ID send-a-test-notification |
nothing calls this directly
no test coverage detected