show waterlevel for the next days #466

Merged
philipp merged 39 commits from show-waterlevel into main 2024-05-16 21:32:24 +02:00
Showing only changes of commit f08d9728eb - Show all commits

View File

@ -250,7 +250,13 @@ async fn create_kiosk(
} else if let Some(shipmaster) = data.shipmaster { } else if let Some(shipmaster) = data.shipmaster {
User::find_by_id(db, shipmaster as i32).await.unwrap() User::find_by_id(db, shipmaster as i32).await.unwrap()
} else { } else {
User::find_by_id(db, data.rowers[0] as i32).await.unwrap() let Some(rower) = data.rowers.get(0) else {
return Flash::error(
Redirect::to("/log"),
"Ausfahrt ohne Benutzer kann nicht angelegt werden.",
);
};
User::find_by_id(db, *rower as i32).await.unwrap()
}; };
Log::create( Log::create(
db, db,