forked from Ruderverein-Donau-Linz/rowt
even more tests!
This commit is contained in:
@ -51,9 +51,13 @@ async fn create(
|
||||
|
||||
#[get("/planned-event/<id>/delete")]
|
||||
async fn delete(db: &State<SqlitePool>, id: i64, _admin: AdminUser) -> Flash<Redirect> {
|
||||
PlannedEvent::delete(db, id).await;
|
||||
|
||||
Flash::success(Redirect::to("/"), "Successfully deleted the event")
|
||||
match PlannedEvent::find_by_id(db, id).await {
|
||||
Some(planned_event) => {
|
||||
planned_event.delete(db).await;
|
||||
Flash::success(Redirect::to("/"), "Successfully deleted the event")
|
||||
}
|
||||
None => Flash::error(Redirect::to("/"), "PlannedEvent does not exist"),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn routes() -> Vec<Route> {
|
||||
|
@ -72,6 +72,9 @@ async fn join(db: &State<SqlitePool>, trip_details_id: i64, user: User) -> Flash
|
||||
Err(UserTripError::AlreadyRegisteredAsCox) => {
|
||||
Flash::error(Redirect::to("/"), "Du hilfst bereits als Steuerperson aus!")
|
||||
}
|
||||
Err(UserTripError::TripDetailsNotFound) => {
|
||||
Flash::error(Redirect::to("/"), "Trip_details do not exist.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user