mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
25 lines
511 B
Go
25 lines
511 B
Go
|
package room
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"gitlab.com/demodesk/neko/server/pkg/utils"
|
||
|
)
|
||
|
|
||
|
func (h *RoomHandler) settingsGet(w http.ResponseWriter, r *http.Request) error {
|
||
|
settings := h.sessions.Settings()
|
||
|
return utils.HttpSuccess(w, settings)
|
||
|
}
|
||
|
|
||
|
func (h *RoomHandler) settingsSet(w http.ResponseWriter, r *http.Request) error {
|
||
|
settings := h.sessions.Settings()
|
||
|
|
||
|
if err := utils.HttpJsonRequest(w, r, &settings); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
h.sessions.UpdateSettings(settings)
|
||
|
|
||
|
return utils.HttpSuccess(w)
|
||
|
}
|