From 5d21e028db50c982392cd28e3ba5647dc50bf920 Mon Sep 17 00:00:00 2001 From: emilis Date: Wed, 14 Sep 2022 01:33:50 +0100 Subject: [PATCH] fixed 404 navbar --- src/servek/html.rs | 7 +++---- src/servek/servek.rs | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/servek/html.rs b/src/servek/html.rs index 1bf41ae..bd51e21 100644 --- a/src/servek/html.rs +++ b/src/servek/html.rs @@ -68,10 +68,9 @@ impl Server { Extension(srv): Extension, cookies: Cookies, ) -> Result { - let user = srv.from_cookies(cookies)?; Ok(( StatusCode::OK, - response::Html(srv.hb.render("index", &user)?), + response::Html(srv.hb.render("index", &srv.from_cookies(cookies)?)?), )) } @@ -95,8 +94,8 @@ impl Server { cookies: Cookies, ) -> Result { Ok(( - StatusCode::OK, - response::Html(srv.hb.render("404", &srv.from_cookies(cookies)?)?), + StatusCode::NOT_FOUND, + response::Html(srv.hb.render("err404", &srv.from_cookies(cookies)?)?), )) } diff --git a/src/servek/servek.rs b/src/servek/servek.rs index 33fb71e..0afe514 100644 --- a/src/servek/servek.rs +++ b/src/servek/servek.rs @@ -41,8 +41,8 @@ impl Server { .expect("success-partial"); hb.register_template_string("index", include_str!("../../templates/html/index.html")) .expect("index"); - hb.register_template_string("404", include_str!("../../templates/html/404.html")) - .expect("404"); + hb.register_template_string("err404", include_str!("../../templates/html/404.html")) + .expect("err404"); hb.register_partial( "LoggedOut", include_str!("../../templates/html/nav-loggedout.html"),