faq own page
Some checks failed
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled

This commit is contained in:
2024-12-11 21:10:29 +01:00
parent a2741b8d4e
commit 6b96c443ea
4 changed files with 85 additions and 76 deletions

View File

@@ -52,6 +52,19 @@ async fn index(db: &State<SqlitePool>, user: User, flash: Option<FlashMessage<'_
Template::render("index", context.into_json())
}
#[get("/faq")]
async fn faq(db: &State<SqlitePool>, user: User, flash: Option<FlashMessage<'_>>) -> Template {
let mut context = Context::new();
if let Some(msg) = flash {
context.insert("flash", &msg.into_inner());
}
context.insert("loggedin_user", &UserWithDetails::from_user(user, db).await);
Template::render("faq", context.into_json())
}
#[get("/notifications")]
async fn notifications(
db: &State<SqlitePool>,
@@ -235,7 +248,7 @@ async fn remove(db: &State<SqlitePool>, trip_details_id: i64, user: User) -> Fla
}
pub fn routes() -> Vec<Route> {
routes![index, join, remove, remove_guest, notifications]
routes![index, join, remove, remove_guest, notifications, faq]
}
#[cfg(test)]