Replace Web Push and its service worker with page notifications over SSE
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user