(state: State<AppState>)
| 117 | } |
| 118 | |
| 119 | async fn new_post(state: State<AppState>) -> Result<Html<String>, (StatusCode, &'static str)> { |
| 120 | let ctx = tera::Context::new(); |
| 121 | let body = state |
| 122 | .templates |
| 123 | .render("new.html.tera", &ctx) |
| 124 | .map_err(|_| (StatusCode::INTERNAL_SERVER_ERROR, "Template error"))?; |
| 125 | |
| 126 | Ok(Html(body)) |
| 127 | } |
| 128 | |
| 129 | async fn create_post( |
| 130 | state: State<AppState>, |