mirror of
https://github.com/Luzifer/twitch-manager.git
synced 2024-12-30 08:31:18 +00:00
Move string to constant
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
a7337cf9f1
commit
a2484972fe
1 changed files with 2 additions and 1 deletions
3
api.go
3
api.go
|
@ -18,6 +18,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
msgTypeAlert string = "alert"
|
||||||
msgTypeBits string = "bits"
|
msgTypeBits string = "bits"
|
||||||
msgTypeHost string = "host"
|
msgTypeHost string = "host"
|
||||||
msgTypeRaid string = "raid"
|
msgTypeRaid string = "raid"
|
||||||
|
@ -122,7 +123,7 @@ func handleCustomAlert(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := subscriptions.SendAllSockets("alert", alert); err != nil {
|
if err := subscriptions.SendAllSockets(msgTypeAlert, alert); err != nil {
|
||||||
http.Error(w, errors.Wrap(err, "send to sockets").Error(), http.StatusInternalServerError)
|
http.Error(w, errors.Wrap(err, "send to sockets").Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue