mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-05-18 07:18:55 +00:00
Cleaning up post_link_tags
This commit is contained in:
parent
04f7d390f5
commit
2029c853b9
1 changed files with 0 additions and 3 deletions
|
@ -12,7 +12,6 @@ struct Params {
|
||||||
|
|
||||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||||
cfg.route("/post_link_tags", web::get().to(get_post_links_response));
|
cfg.route("/post_link_tags", web::get().to(get_post_links_response));
|
||||||
// .app_data(Data::new(client));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn get_post_links_response(
|
async fn get_post_links_response(
|
||||||
|
@ -21,12 +20,10 @@ async fn get_post_links_response(
|
||||||
) -> Result<HttpResponse, Error> {
|
) -> Result<HttpResponse, Error> {
|
||||||
let url =
|
let url =
|
||||||
Url::parse(&info.url).map_err(|_| ErrorBadRequest(LemmyError::from(anyhow!("not_found"))))?;
|
Url::parse(&info.url).map_err(|_| ErrorBadRequest(LemmyError::from(anyhow!("not_found"))))?;
|
||||||
println!("url: {:?}", url);
|
|
||||||
|
|
||||||
let json = fetch_post_link_tags(context.client(), &url)
|
let json = fetch_post_link_tags(context.client(), &url)
|
||||||
.await
|
.await
|
||||||
.map_err(|_| ErrorBadRequest(LemmyError::from(anyhow!("not_found"))))?;
|
.map_err(|_| ErrorBadRequest(LemmyError::from(anyhow!("not_found"))))?;
|
||||||
println!("json: {:?}", json);
|
|
||||||
|
|
||||||
Ok(HttpResponse::Ok().json(json))
|
Ok(HttpResponse::Ok().json(json))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue