summaryrefslogtreecommitdiff
path: root/src/handlers.rs
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2025-06-01 19:59:08 -0400
committerAdam T. Carpenter <atc@53hor.net>2025-06-01 19:59:08 -0400
commitb56c8359f17fd5464dd3ebdbe23fcbe35f0e49ad (patch)
treeda8be3af4dffab2ca0223c57564755f84ebe286d /src/handlers.rs
parent6c736b1fc1626b0ff2ff752fe0a6ab8a9d0e6ca4 (diff)
downloadcarpentertutoring-b56c8359f17fd5464dd3ebdbe23fcbe35f0e49ad.tar.xz
carpentertutoring-b56c8359f17fd5464dd3ebdbe23fcbe35f0e49ad.zip
fix: amy proofreads
Diffstat (limited to 'src/handlers.rs')
-rw-r--r--src/handlers.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/handlers.rs b/src/handlers.rs
index 8b3ea27..aa36e15 100644
--- a/src/handlers.rs
+++ b/src/handlers.rs
@@ -11,7 +11,7 @@ use crate::views::posts::PostsView;
use crate::views::pro::ProTemplate;
use askama::Template;
use axum::extract::{Path, State};
-use axum::response::Html;
+use axum::response::{Html, Redirect};
use std::sync::Arc;
pub async fn about_handler(State(repo): State<Arc<impl TutorRepo>>) -> Html<String> {
@@ -44,6 +44,10 @@ pub async fn post_handler(
Html(view.render().unwrap())
}
+pub async fn post_redirect(Path(post_id): Path<String>) -> Redirect {
+ Redirect::permanent(&format!("/blog/{post_id}"))
+}
+
pub async fn k12_handler() -> Html<String> {
Html(K12Template {}.render().unwrap())
}