Merge branch 'anoa/no_require_preset' into anoa/testing

This commit is contained in:
Andrew Morgan 2018-06-12 16:26:59 +01:00
commit 1401a102fc

View file

@ -87,13 +87,15 @@ func (r createRoomRequest) Validate() *util.JSONResponse {
} }
} }
} }
switch r.Preset { if r.Preset != "" {
case presetPrivateChat, presetTrustedPrivateChat, presetPublicChat: switch r.Preset {
break case presetPrivateChat, presetTrustedPrivateChat, presetPublicChat:
default: break
return &util.JSONResponse{ default:
Code: http.StatusBadRequest, return &util.JSONResponse{
JSON: jsonerror.BadJSON("preset must be any of 'private_chat', 'trusted_private_chat', 'public_chat'"), Code: http.StatusBadRequest,
JSON: jsonerror.BadJSON("preset must be any of 'private_chat', 'trusted_private_chat', 'public_chat'"),
}
} }
} }