only show non-placed boats in boathouse list
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled

This commit is contained in:
2024-04-13 09:42:12 +02:00
parent 3b04b39d66
commit cfc35fbec6
2 changed files with 21 additions and 1 deletions

View File

@ -25,7 +25,14 @@ async fn index(
}
let boats = Boat::all_for_boatshouse(db).await;
context.insert("boats", &boats);
let mut final_boats = Vec::new();
for boat in boats {
if boat.boat.boathouse(db).await.is_none() {
final_boats.push(boat);
}
}
context.insert("boats", &final_boats);
let boathouse = Boathouse::get(db).await;
context.insert("boathouse", &boathouse);