Login
4 branches 0 tags
Ben (Desktop/Arch) No more lit 79ed3a7 1 month ago 124 Commits
rubhub / src / controllers / not_found.rs
use askama::Template;
use axum::{http::StatusCode, response::Html};

use crate::{User, views::ThemedRender};

#[derive(Template)]
#[template(path = "404.html")]
struct NotFoundTemplate<'a> {
    logged_in_user: Option<&'a User>,
}

pub async fn not_found() -> (StatusCode, Html<String>) {
    let template = NotFoundTemplate {
        logged_in_user: None,
    };
    (
        StatusCode::NOT_FOUND,
        Html(template.render_with_theme()),
    )
}