Fix: Add support for variant in API

This commit is contained in:
Knut Ahlers 2020-11-23 11:42:42 +01:00
parent 79fd31ec4e
commit d1932e2fbd
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

7
api.go
View file

@ -99,9 +99,10 @@ func registerAPI(r *mux.Router) {
func handleCustomAlert(w http.ResponseWriter, r *http.Request) { func handleCustomAlert(w http.ResponseWriter, r *http.Request) {
var alert struct { var alert struct {
Sound *string `json:"sound"` Sound *string `json:"sound"`
Text string `json:"text"` Text string `json:"text"`
Title string `json:"title"` Title string `json:"title"`
Variant *string `json:"variant"`
} }
if err := json.NewDecoder(r.Body).Decode(&alert); err != nil { if err := json.NewDecoder(r.Body).Decode(&alert); err != nil {