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

Function delete

examples/salvo_example/api/src/lib.rs:128–141  ·  view source on GitHub ↗
(req: &mut Request, depot: &mut Depot, res: &mut Response)

Source from the content-addressed store, hash-verified

126
127#[handler]
128async fn delete(req: &mut Request, depot: &mut Depot, res: &mut Response) -> Result<()> {
129 let state = depot
130 .obtain::<AppState>()
131 .ok_or_else(StatusError::internal_server_error)?;
132 let conn = &state.conn;
133 let id = req.param::<i32>("id").unwrap_or_default();
134
135 Mutation::delete_post(conn, id)
136 .await
137 .map_err(|_| StatusError::internal_server_error())?;
138
139 Redirect::found("/").render(res);
140 Ok(())
141}
142
143#[tokio::main]
144pub async fn main() {

Callers

nothing calls this directly

Calls 1

delete_postFunction · 0.85

Tested by

no test coverage detected