(depot: &mut Depot)
| 70 | |
| 71 | #[handler] |
| 72 | async fn new(depot: &mut Depot) -> Result<Text<String>> { |
| 73 | let state = depot |
| 74 | .obtain::<AppState>() |
| 75 | .ok_or_else(StatusError::internal_server_error)?; |
| 76 | let ctx = tera::Context::new(); |
| 77 | let body = state |
| 78 | .templates |
| 79 | .render("new.html.tera", &ctx) |
| 80 | .map_err(|_| StatusError::internal_server_error())?; |
| 81 | Ok(Text::Html(body)) |
| 82 | } |
| 83 | |
| 84 | #[handler] |
| 85 | async fn edit(req: &mut Request, depot: &mut Depot) -> Result<Text<String>> { |
no outgoing calls