+ Fixed issue with /channels/delete return 200 on db-lib failure

This commit is contained in:
shockrah 2020-11-17 22:31:33 -08:00
parent 5d8ecdfdb7
commit 8b7684c0a7

View File

@ -78,8 +78,14 @@ pub async fn delete_channel(pool: &Pool, response: &mut Response<Body>, params:
// TODO: something more intelligent with the logging im ngl
match Channel::delete(pool, id).await {
db::Response::Success => {},
db::Response::Other(data) => println!("\t{}", data),
_ => {}
db::Response::Other(data) => {
eprintln!("\t{}", data);
*response.status_mut() = StatusCode::INTERNAL_SERVER_ERROR;
}
_ => {
eprintln!("\tBro like restart the server");
*response.status_mut() = StatusCode::INTERNAL_SERVER_ERROR;
}
}
}
else {