fix tests
This commit is contained in:
@@ -62,7 +62,8 @@ async fn index_loggedin(
|
||||
&UserWithDetails::from_user(user.into_inner(), db).await,
|
||||
);
|
||||
|
||||
index(db, flash, context).await
|
||||
let context = index(db, flash, context).await;
|
||||
Template::render("log", context.into_json())
|
||||
}
|
||||
|
||||
#[get("/")]
|
||||
@@ -78,10 +79,11 @@ async fn index_kiosk(
|
||||
|
||||
context.insert("show_kiosk_header", &true);
|
||||
|
||||
index(db, flash, context).await
|
||||
let context = index(db, flash, context).await;
|
||||
Template::render("kiosk", context.into_json())
|
||||
}
|
||||
|
||||
async fn index(db: &SqlitePool, flash: Option<FlashMessage<'_>>, mut context: Context) -> Template {
|
||||
async fn index(db: &SqlitePool, flash: Option<FlashMessage<'_>>, mut context: Context) -> Context {
|
||||
if let Some(msg) = flash {
|
||||
context.insert("flash", &msg.into_inner());
|
||||
}
|
||||
@@ -120,7 +122,7 @@ async fn index(db: &SqlitePool, flash: Option<FlashMessage<'_>>, mut context: Co
|
||||
context.insert("on_water", &on_water);
|
||||
context.insert("distances", &distances);
|
||||
|
||||
Template::render("kiosk", context.into_json())
|
||||
context
|
||||
}
|
||||
|
||||
#[get("/show", rank = 3)]
|
||||
|
Reference in New Issue
Block a user