allow 'always_show' when creating events

This commit is contained in:
2024-09-02 12:32:26 +03:00
parent 99a49dbec9
commit 49b2305cdb
4 changed files with 26 additions and 2 deletions

View File

@ -18,6 +18,7 @@ use crate::model::{
struct AddEventForm<'r> {
name: &'r str,
planned_amount_cox: i32,
always_show: bool,
tripdetails: TripDetailsToAdd<'r>,
}
@ -34,7 +35,14 @@ async fn create(
//just created
//the object
Event::create(db, data.name, data.planned_amount_cox, &trip_details).await;
Event::create(
db,
data.name,
data.planned_amount_cox,
data.always_show,
&trip_details,
)
.await;
Flash::success(Redirect::to("/planned"), "Event hinzugefügt")
}