set content type

This commit is contained in:
philipp 2023-06-05 14:15:17 +02:00
parent b6057f066d
commit 7614cab806

View File

@ -1,4 +1,4 @@
use rocket::{get, routes, Route, State};
use rocket::{get, http::ContentType, routes, Route, State};
use rocket_dyn_templates::{context, Template};
use sqlx::SqlitePool;
@ -10,8 +10,8 @@ async fn faq(user: User) -> Template {
}
#[get("/cal")]
async fn cal(db: &State<SqlitePool>) -> String {
PlannedEvent::get_ics_feed(db).await
async fn cal(db: &State<SqlitePool>) -> (ContentType, String) {
(ContentType::Calendar, PlannedEvent::get_ics_feed(db).await)
}
pub fn routes() -> Vec<Route> {