don't show external boats in boatstat; hide logout in menu; move owner into own column in boatstat
Some checks failed
CI/CD Pipeline / test (push) Has been cancelled
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled

This commit is contained in:
2024-04-14 20:20:22 +02:00
parent ea70170d2b
commit 7ebbf5661a
3 changed files with 24 additions and 39 deletions

View File

@ -17,6 +17,7 @@ pub struct BoatStat {
pub struct SingleBoatStat {
name: String,
location: String,
owner: String,
years: HashMap<String, i32>,
}
@ -39,7 +40,7 @@ LEFT JOIN
LEFT JOIN
location ON boat.location_id = location.id
WHERE
boat.name != 'Externes Boot'
boat.name != 'Externes Boot' AND not boat.external
GROUP BY
boat.id, year
ORDER BY
@ -58,7 +59,7 @@ ORDER BY
} else {
String::from("Verein")
};
let name = format!("{} ({})", boat.name, owner);
let name = boat.name.clone();
let location: String = row.get("location");
let year: i32 = row.get("year");
if year == 0 {
@ -78,6 +79,7 @@ ORDER BY
.or_insert(SingleBoatStat {
name,
location,
owner,
years: HashMap::new(),
});
boat_stat.years.insert(year, rowed_km);