allow admins to show logbook for any year
Some checks failed
CI/CD Pipeline / test (push) Failing after 10m41s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
2024-03-05 08:59:44 +01:00
parent ae98a4278d
commit 58f8cb14b8
2 changed files with 16 additions and 1 deletions

View File

@ -260,6 +260,10 @@ ORDER BY departure DESC
pub async fn completed(db: &SqlitePool) -> Vec<LogbookWithBoatAndRowers> {
let year = chrono::Local::now().year();
Self::completed_in_year(db, year).await
}
pub async fn completed_in_year(db: &SqlitePool, year: i32) -> Vec<LogbookWithBoatAndRowers> {
let logs = sqlx::query_as(
&format!("
SELECT id, boat_id, shipmaster, steering_person, shipmaster_only_steering, departure, arrival, destination, distance_in_km, comments, logtype