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

Function delete_post

examples/axum_example/api/src/lib.rs:188–203  ·  view source on GitHub ↗
(
    state: State<AppState>,
    Path(id): Path<i32>,
    mut cookies: Cookies,
)

Source from the content-addressed store, hash-verified

186}
187
188async fn delete_post(
189 state: State<AppState>,
190 Path(id): Path<i32>,
191 mut cookies: Cookies,
192) -> Result<PostResponse, (StatusCode, &'static str)> {
193 MutationCore::delete_post(&state.conn, id)
194 .await
195 .expect("could not delete post");
196
197 let data = FlashData {
198 kind: "success".to_owned(),
199 message: "Post successfully deleted".to_owned(),
200 };
201
202 Ok(post_response(&mut cookies, data))
203}
204
205pub fn main() {
206 let result = start();

Callers 15

mainFunction · 0.85
deleteMethod · 0.85
mainFunction · 0.85
delete_postMethod · 0.85
mainFunction · 0.85
mainFunction · 0.85
deleteFunction · 0.85
mainFunction · 0.85
deleteFunction · 0.85
mainFunction · 0.85
deleteFunction · 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