only show non-placed boats in boathouse list
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user