Files
byre/internal/server/notifications.go
T

22 lines
392 B
Go
Raw Normal View History

package server
import (
"net/http"
"g.fc.run/misc/byre/internal/api"
)
func (s *Server) UpdateNotificationPrefs(w http.ResponseWriter, r *http.Request) {
req := api.NotificationPrefs{}
if !readJSON(w, r, &req) {
return
}
u, err := s.store.UpdateNotificationPrefs(r.Context(), actor(r), req)
if err != nil {
writeStoreError(w, err)
return
}
writeJSON(w, http.StatusOK, u)
}