MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / new_post

Function new_post

examples/axum_example/api/src/lib.rs:119–127  ·  view source on GitHub ↗
(state: State<AppState>)

Source from the content-addressed store, hash-verified

117}
118
119async 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
129async fn create_post(
130 state: State<AppState>,

Callers

nothing calls this directly

Calls 1

newFunction · 0.50

Tested by

no test coverage detected