rowt/src/rest/misc.rs

20 lines
453 B
Rust
Raw Normal View History

2023-05-24 15:36:38 +02:00
use rocket::{get, routes, Route, State};
use rocket_dyn_templates::{context, Template};
use sqlx::SqlitePool;
use crate::model::{planned_event::PlannedEvent, user::User};
#[get("/faq")]
async fn faq(user: User) -> Template {
Template::render("faq", context!(loggedin_user: user))
}
#[get("/cal")]
async fn cal(db: &State<SqlitePool>) -> String {
PlannedEvent::get_ics_feed(db).await
}
pub fn routes() -> Vec<Route> {
routes![faq, cal]
}