proper redirects

This commit is contained in:
philipp 2023-07-27 14:50:44 +02:00
parent 7093e29c9b
commit 621058356d

View File

@ -150,7 +150,7 @@ async fn home_kiosk(
let logbook = Logbook::find_by_id(db, logbook_id).await; let logbook = Logbook::find_by_id(db, logbook_id).await;
let Some(logbook) = logbook else { let Some(logbook) = logbook else {
return Flash::error( return Flash::error(
Redirect::to("/admin/log"), Redirect::to("/log/kiosk"),
format!("Log with ID {} does not exist!", logbook_id), format!("Log with ID {} does not exist!", logbook_id),
) )
}; };
@ -165,9 +165,9 @@ async fn home_kiosk(
) )
.await .await
{ {
Ok(_) => Flash::success(Redirect::to("/log"), "Successfully updated log"), Ok(_) => Flash::success(Redirect::to("/log/kiosk"), "Successfully updated log"),
Err(_) => Flash::error( Err(_) => Flash::error(
Redirect::to("/log"), Redirect::to("/log/kiosk"),
format!("Logbook with ID {} could not be updated!", logbook_id), format!("Logbook with ID {} could not be updated!", logbook_id),
), ),
} }