From bdc5e71e4293a46e86fe4d1dd5c480926e73acd5 Mon Sep 17 00:00:00 2001 From: Harsh Khandeparkar Date: Mon, 11 Nov 2024 19:08:51 +0530 Subject: [PATCH] fix: with url in similar papers endpoint --- backend/src/routing/handlers.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/routing/handlers.rs b/backend/src/routing/handlers.rs index a8320b6..9760163 100644 --- a/backend/src/routing/handlers.rs +++ b/backend/src/routing/handlers.rs @@ -10,7 +10,7 @@ use axum::{ http::StatusCode, Extension, }; -use color_eyre::eyre::ContextCompat; +use color_eyre::eyre::{ContextCompat, Result}; use http::HeaderMap; use serde::Serialize; use tokio::fs; @@ -435,6 +435,9 @@ pub async fn similar( Ok(BackendResponse::ok( format!("Found {} similar papers.", papers.len()), - papers, + papers + .iter() + .map(|paper| paper.to_owned().with_url(&state.env_vars)) + .collect::>>()?, )) }