Update main

This commit is contained in:
structix committed 2026-09-21 21:31:16 +02:00
1 parent b84b0c4138
commit 32f1f74bd9
1 file changed
+13 -5
+13 -5
View File
@@ -2,10 +2,10 @@ mod db;
use askama::Template; use askama::Template;
use axum::{ use axum::{
Router,
extract::{Form, FromRef, State}, extract::{Form, FromRef, State},
response::{Html, Redirect}, response::{Html, Redirect},
routing::{get, post}, routing::{get, post},
Router,
}; };
use axum_extra::extract::cookie::{Cookie, Key, PrivateCookieJar}; use axum_extra::extract::cookie::{Cookie, Key, PrivateCookieJar};
use rusqlite::Connection; use rusqlite::Connection;
@@ -103,7 +103,13 @@ async fn index(State(state): State<AppState>) -> Html<String> {
}) })
.collect(); .collect();
ExerciseStats { name, month, year, all_time, daily } ExerciseStats {
name,
month,
year,
all_time,
daily,
}
}) })
.collect(); .collect();
@@ -129,9 +135,11 @@ async fn login_post(
Ok((jar, Redirect::to("/manage"))) Ok((jar, Redirect::to("/manage")))
} else { } else {
Err(Html( Err(Html(
LoginTemplate { error: Some("Wrong password.".to_string()) } LoginTemplate {
.render() error: Some("Wrong password.".to_string()),
.unwrap(), }
.render()
.unwrap(),
)) ))
} }
} }