2022-03-27 12:26:25 +13:00
|
|
|
package room
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2022-07-14 10:58:22 +12:00
|
|
|
"github.com/demodesk/neko/pkg/utils"
|
2022-03-27 12:26:25 +13:00
|
|
|
)
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|