* 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:
parent
928c6336d3
commit
32dbbe11eb
@ -55,16 +55,15 @@ pub async fn create_channel(pool: &Pool, response: &mut Response<Body>, params:
|
|||||||
match Channel::add(pool, name, description, kind).await {
|
match Channel::add(pool, name, description, kind).await {
|
||||||
Ok(resp) => {
|
Ok(resp) => {
|
||||||
match resp {
|
match resp {
|
||||||
#[cfg(feature = "rtc")]
|
|
||||||
Row(channel) => {
|
Row(channel) => {
|
||||||
use crate::rtc;
|
#[cfg(feature = "rtc")]
|
||||||
|
{
|
||||||
|
use crate::rtc;
|
||||||
|
rtc::create_channel(channel).await;
|
||||||
|
}
|
||||||
set_json_body(response, json!({"channel": channel}));
|
set_json_body(response, json!({"channel": channel}));
|
||||||
rtc::create_channel(channel).await;
|
|
||||||
StatusCode::OK
|
StatusCode::OK
|
||||||
},
|
},
|
||||||
#[cfg(not(feature = "rtc"))]
|
|
||||||
Row(_) => { StatusCode::OK },
|
|
||||||
|
|
||||||
RestrictedInput(_) => StatusCode::UNPROCESSABLE_ENTITY,
|
RestrictedInput(_) => StatusCode::UNPROCESSABLE_ENTITY,
|
||||||
// Unreachable
|
// Unreachable
|
||||||
_ => {
|
_ => {
|
||||||
|
Loading…
Reference in New Issue
Block a user