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

Function create_post

examples/axum_example/api/src/lib.rs:129–146  ·  view source on GitHub ↗
(
    state: State<AppState>,
    mut cookies: Cookies,
    form: Form<post::Model>,
)

Source from the content-addressed store, hash-verified

127}
128
129async fn create_post(
130 state: State<AppState>,
131 mut cookies: Cookies,
132 form: Form<post::Model>,
133) -> Result<PostResponse, (StatusCode, &'static str)> {
134 let form = form.0;
135
136 MutationCore::create_post(&state.conn, form)
137 .await
138 .expect("could not insert post");
139
140 let data = FlashData {
141 kind: "success".to_owned(),
142 message: "Post successfully added".to_owned(),
143 };
144
145 Ok(post_response(&mut cookies, data))
146}
147
148async fn edit_post(
149 state: State<AppState>,

Callers 15

mainFunction · 0.85
insertMethod · 0.85
mainFunction · 0.85
add_postMethod · 0.85
mainFunction · 0.85
mainFunction · 0.85
createFunction · 0.85
mainFunction · 0.85
createFunction · 0.85
mainFunction · 0.85
createFunction · 0.85
mainFunction · 0.85

Calls 1

post_responseFunction · 0.85

Tested by 8

mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68