diff --git a/server/handlers/room.go b/server/handlers/room.go index b9f8d7f..67d7efd 100644 --- a/server/handlers/room.go +++ b/server/handlers/room.go @@ -68,7 +68,7 @@ func CreateRoom(ctx *gin.Context) { return } - room, err := user.CreateRoom(req.RoomName, req.Password, db.WithSettingHidden(req.Hidden)) + room, err := user.CreateRoom(req.RoomName, req.Password, db.WithSettingHidden(req.Settings.Hidden)) if err != nil { log.Errorf("create room failed: %v", err) ctx.AbortWithStatusJSON(http.StatusBadRequest, model.NewApiErrorResp(err)) diff --git a/server/model/room.go b/server/model/room.go index c897362..137707e 100644 --- a/server/model/room.go +++ b/server/model/room.go @@ -28,7 +28,9 @@ func (f FormatEmptyPasswordError) Error() string { type CreateRoomReq struct { RoomName string `json:"roomName"` Password string `json:"password"` - Hidden bool `json:"hidden"` + Settings struct { + Hidden bool `json:"hidden"` + } `json:"settings"` } func (c *CreateRoomReq) Decode(ctx *gin.Context) error {