Use same commit link style everywhere

This commit is contained in:
Joscha 2023-08-06 23:38:12 +02:00
parent 2b81d497bc
commit 794787a4be
10 changed files with 96 additions and 75 deletions

View file

@ -11,6 +11,7 @@ struct Ref {
name: String,
hash: String,
short: String,
reachable: i64,
tracked: bool,
}
@ -28,16 +29,18 @@ pub async fn get(
) -> somehow::Result<impl IntoResponse> {
let refs = sqlx::query!(
"\
SELECT name, hash, tracked, message FROM refs \
SELECT name, hash, message, reachable, tracked \
FROM refs \
JOIN commits USING (hash) \
ORDER BY name ASC \
"
)
.fetch(&db)
.map_ok(|r| Ref {
name: r.name,
short: util::format_commit_short(&r.hash, &r.message),
name: r.name,
hash: r.hash,
reachable: r.reachable,
tracked: r.tracked != 0,
})
.try_collect::<Vec<_>>()

View file

@ -10,6 +10,7 @@ use super::{Base, Tab};
struct Task {
id: String,
short: String,
reachable: i64,
since: String,
priority: i64,
odd: bool,
@ -22,6 +23,7 @@ async fn get_queue(db: &SqlitePool) -> somehow::Result<Vec<Task>> {
id, \
hash, \
message, \
reachable, \
date AS \"date: time::OffsetDateTime\", \
priority \
FROM queue \
@ -33,6 +35,7 @@ async fn get_queue(db: &SqlitePool) -> somehow::Result<Vec<Task>> {
.map_ok(|r| Task {
id: r.id,
short: util::format_commit_short(&r.hash, &r.message),
reachable: r.reachable,
since: util::format_delta_from_now(r.date),
priority: r.priority,
odd: false,