* Fixing /channel/create response body

Now it always returns a json structure where before only the rtc branch was
doing this.
This commit is contained in:
shockrah 2021-05-29 14:22:24 -07:00
parent 928c6336d3
commit 32dbbe11eb

View File

@ -55,16 +55,15 @@ pub async fn create_channel(pool: &Pool, response: &mut Response<Body>, params:
match Channel::add(pool, name, description, kind).await {
Ok(resp) => {
match resp {
#[cfg(feature = "rtc")]
Row(channel) => {
#[cfg(feature = "rtc")]
{
use crate::rtc;
set_json_body(response, json!({"channel": channel}));
rtc::create_channel(channel).await;
}
set_json_body(response, json!({"channel": channel}));
StatusCode::OK
},
#[cfg(not(feature = "rtc"))]
Row(_) => { StatusCode::OK },
RestrictedInput(_) => StatusCode::UNPROCESSABLE_ENTITY,
// Unreachable
_ => {