From 32dbbe11eb943457c8d7443322bd781c72482f78 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sat, 29 May 2021 14:22:24 -0700 Subject: [PATCH] * Fixing /channel/create response body Now it always returns a json structure where before only the rtc branch was doing this. --- json-api/src/channels.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/json-api/src/channels.rs b/json-api/src/channels.rs index 3f30c40..6be6e50 100644 --- a/json-api/src/channels.rs +++ b/json-api/src/channels.rs @@ -55,16 +55,15 @@ pub async fn create_channel(pool: &Pool, response: &mut Response, params: match Channel::add(pool, name, description, kind).await { Ok(resp) => { match resp { - #[cfg(feature = "rtc")] Row(channel) => { - use crate::rtc; + #[cfg(feature = "rtc")] + { + use crate::rtc; + rtc::create_channel(channel).await; + } set_json_body(response, json!({"channel": channel})); - rtc::create_channel(channel).await; StatusCode::OK }, - #[cfg(not(feature = "rtc"))] - Row(_) => { StatusCode::OK }, - RestrictedInput(_) => StatusCode::UNPROCESSABLE_ENTITY, // Unreachable _ => {