Cleaning up post_link_tags

This commit is contained in:
Dessalines 2021-08-16 12:46:50 -04:00
parent 04f7d390f5
commit 2029c853b9

View file

@ -12,7 +12,6 @@ struct Params {
pub fn config(cfg: &mut web::ServiceConfig) {
cfg.route("/post_link_tags", web::get().to(get_post_links_response));
// .app_data(Data::new(client));
}
async fn get_post_links_response(
@ -21,12 +20,10 @@ async fn get_post_links_response(
) -> Result<HttpResponse, Error> {
let url =
Url::parse(&info.url).map_err(|_| ErrorBadRequest(LemmyError::from(anyhow!("not_found"))))?;
println!("url: {:?}", url);
let json = fetch_post_link_tags(context.client(), &url)
.await
.map_err(|_| ErrorBadRequest(LemmyError::from(anyhow!("not_found"))))?;
println!("json: {:?}", json);
Ok(HttpResponse::Ok().json(json))
}