NotificationTemplateParam returns the template from the ExtractNotificationTemplateParam handler.
(r *http.Request)
| 13 | |
| 14 | // NotificationTemplateParam returns the template from the ExtractNotificationTemplateParam handler. |
| 15 | func NotificationTemplateParam(r *http.Request) database.NotificationTemplate { |
| 16 | template, ok := r.Context().Value(notificationTemplateParamContextKey{}).(database.NotificationTemplate) |
| 17 | if !ok { |
| 18 | panic("developer error: notification template middleware not used") |
| 19 | } |
| 20 | return template |
| 21 | } |
| 22 | |
| 23 | // ExtractNotificationTemplateParam grabs a notification template from the "notification_template" URL parameter. |
| 24 | func ExtractNotificationTemplateParam(db database.Store) func(http.Handler) http.Handler { |
no test coverage detected