Update dependencies
This commit is contained in:
@ -2,8 +2,8 @@ use crate::auth::Authorized;
|
||||
use crate::status_json::StatusJson;
|
||||
use chrono::{Duration, Local, NaiveDate};
|
||||
use itertools::Itertools;
|
||||
use rocket::{get, State};
|
||||
use rocket_contrib::templates::Template;
|
||||
use rocket::{get, response::content::Html, State};
|
||||
use rocket_dyn_templates::Template;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::borrow::Cow;
|
||||
use std::iter::{once, repeat};
|
||||
@ -11,7 +11,10 @@ use std::iter::{once, repeat};
|
||||
pub struct BirthDate(pub NaiveDate);
|
||||
|
||||
#[get("/weeks")]
|
||||
pub fn weeks(_auth: Authorized, birth_date: State<BirthDate>) -> Result<Template, StatusJson> {
|
||||
pub fn weeks(
|
||||
_auth: Authorized,
|
||||
birth_date: &State<BirthDate>,
|
||||
) -> Result<Html<Template>, StatusJson> {
|
||||
type Color<'a> = Cow<'a, str>;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
@ -105,5 +108,5 @@ pub fn weeks(_auth: Authorized, birth_date: State<BirthDate>) -> Result<Template
|
||||
.collect(),
|
||||
};
|
||||
|
||||
Ok(Template::render("weeks", &context))
|
||||
Ok(Html(Template::render("weeks", &context)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user