fix(room): accept room_public JSON key for HTTP fallback
Some checks are pending
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions

The frontend WebSocket client sends room_public, but the HTTP fallback
sends it as a JSON body parsed directly into RoomCreateRequest/RoomUpdateRequest
which expects public. Add #[serde(rename = "room_public")] so both
ws params and HTTP JSON body work consistently.
This commit is contained in:
ZhenYi 2026-04-16 18:27:53 +08:00
parent 8b433c9169
commit df87a65cbb

View File

@ -113,6 +113,7 @@ pub struct RoomCategoryResponse {
#[derive(Debug, Clone, Deserialize, Serialize, utoipa::ToSchema)] #[derive(Debug, Clone, Deserialize, Serialize, utoipa::ToSchema)]
pub struct RoomCreateRequest { pub struct RoomCreateRequest {
pub room_name: String, pub room_name: String,
#[serde(rename = "room_public")]
pub public: bool, pub public: bool,
pub category: Option<Uuid>, pub category: Option<Uuid>,
} }
@ -120,6 +121,7 @@ pub struct RoomCreateRequest {
#[derive(Debug, Clone, Deserialize, Serialize, utoipa::ToSchema)] #[derive(Debug, Clone, Deserialize, Serialize, utoipa::ToSchema)]
pub struct RoomUpdateRequest { pub struct RoomUpdateRequest {
pub room_name: Option<String>, pub room_name: Option<String>,
#[serde(rename = "room_public")]
pub public: Option<bool>, pub public: Option<bool>,
pub category: Option<Uuid>, pub category: Option<Uuid>,
} }