summaryrefslogtreecommitdiffstats
path: root/src/http
diff options
context:
space:
mode:
Diffstat (limited to 'src/http')
-rw-r--r--src/http/routes.rs15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/http/routes.rs b/src/http/routes.rs
index abd7345..f4ab2ca 100644
--- a/src/http/routes.rs
+++ b/src/http/routes.rs
@@ -693,20 +693,7 @@ fn package_detail(state: &State, req: &Req, name: &str) -> Res {
published_at: r.published_at.unwrap_or_else(|| "—".into()),
approver: r
.approval_id
- .and_then(|aid| {
- db.read(|c| {
- use rusqlite::OptionalExtension;
- c.query_row(
- "SELECT COALESCE(note,'') FROM approval WHERE id=?1",
- rusqlite::params![aid],
- |r| r.get::<_, String>(0),
- )
- .optional()
- .map_err(Into::into)
- })
- .ok()
- .flatten()
- })
+ .and_then(|aid| db::approval_note(db, aid).ok().filter(|s| !s.is_empty()))
.filter(|s| !s.is_empty())
.unwrap_or_else(|| "—".into()),
})