clean code with clippy
This commit is contained in:
@@ -8,7 +8,7 @@ use serde::Serialize;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
use crate::model::{
|
||||
planned_event::PlannedEvent,
|
||||
planned_event::{self, PlannedEvent},
|
||||
tripdetails::{TripDetails, TripDetailsToAdd},
|
||||
user::PlannedEventUser,
|
||||
};
|
||||
@@ -57,19 +57,17 @@ async fn update(
|
||||
data: Form<UpdatePlannedEventForm<'_>>,
|
||||
_admin: PlannedEventUser,
|
||||
) -> Flash<Redirect> {
|
||||
let update = planned_event::EventUpdate {
|
||||
name: data.name,
|
||||
planned_amount_cox: data.planned_amount_cox,
|
||||
max_people: data.max_people,
|
||||
notes: data.notes,
|
||||
always_show: data.always_show,
|
||||
is_locked: data.is_locked,
|
||||
};
|
||||
match PlannedEvent::find_by_id(db, data.id).await {
|
||||
Some(planned_event) => {
|
||||
planned_event
|
||||
.update(
|
||||
db,
|
||||
data.name,
|
||||
data.planned_amount_cox,
|
||||
data.max_people,
|
||||
data.notes,
|
||||
data.always_show,
|
||||
data.is_locked,
|
||||
)
|
||||
.await;
|
||||
planned_event.update(db, &update).await;
|
||||
Flash::success(Redirect::to("/planned"), "Event erfolgreich bearbeitet")
|
||||
}
|
||||
None => Flash::error(Redirect::to("/planned"), "Planned event id not found"),
|
||||
|
Reference in New Issue
Block a user