wip: more tests

This commit is contained in:
Robert Perce 2026-02-14 13:35:59 -06:00
parent 7e2f5d0a18
commit b0630a25e1
7 changed files with 114 additions and 10 deletions

View file

@ -87,6 +87,11 @@ mod get {
.fetch_all(pool)
.await?;
let freshened = std::cmp::max(
contact.manually_freshened_at.map(|when| when.date_naive()),
entries.get(0).map(|entry| entry.date),
);
let phone_numbers: Vec<PhoneNumber> = sqlx::query_as!(
PhoneNumber,
"select * from phone_numbers where contact_id = $1",
@ -141,8 +146,8 @@ mod get {
}
label { "freshened" }
div {
@if let Some(when) = &contact.manually_freshened_at {
(when.date_naive().to_string())
@if let Some(freshened) = freshened {
(freshened.to_string())
} @else {
"(never)"
}