2023-06-28 14:06:28 +02:00

20 lines
512 B
Rust

use rocket::{get, http::ContentType, 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>) -> (ContentType, String) {
(ContentType::Calendar, PlannedEvent::get_ics_feed(db).await)
}
pub fn routes() -> Vec<Route> {
routes![faq, cal]
}