added ded simple delete interface for channels

This commit is contained in:
shockrah 2020-09-17 20:10:14 -07:00
parent e616a160fa
commit 5950f3b505

View File

@ -64,6 +64,15 @@ impl FromDB<Channel> for Channel {
} }
async fn delete(p: &Pool, id: UBigInt) -> Response<Channel> { async fn delete(p: &Pool, id: UBigInt) -> Response<Channel> {
unimplemented!() if let Ok(conn) = p.get_conn().await {
let q = "DELETE FROM channels WHERE id = :id";
let result: Result<Conn, SqlError> =
conn.drop_exec(q, params!{"id" => id}).await;
return match result {
Ok(_) => Response::Success,
Err(_) => Response::Other(sql_err!("Member::FromDB::delete Listen i dont know either"))
}
}
return Response::Other(no_conn!("Member::FromDB::delete"))
} }
} }