* channels are now nested in "channels" key

This commit is contained in:
shockrah 2021-03-03 16:30:39 -08:00
parent 080b2cc538
commit b999907540

View File

@ -23,7 +23,7 @@ pub async fn list_channels(pool: &Pool, response: &mut Response<Body>) {
*/
return match db::channels::Channel::filter(pool, 0).await {
db::Response::Set(channels) => {
set_json_body(response, json!(channels));
set_json_body(response, json!({"channels": channels}));
},
db::Response::Other(_msg) => *response.status_mut() = hyper::StatusCode::INTERNAL_SERVER_ERROR,
_ => *response.status_mut() = hyper::StatusCode::INTERNAL_SERVER_ERROR,