use super::api_error; use super::FallibleApiResponse; use rocket::get; use serde_json::json; #[get("/search?")] pub async fn search_route(query: String) -> FallibleApiResponse { Ok(json!(crate::library::search::search_for(query) .await .ok_or_else(|| api_error("Search failed"))?)) }