(
Path(id): Path<i32>,
State(ctx): State<AppContext>,
Json(params): Json<Params>,
)
| 42 | |
| 43 | #[debug_handler] |
| 44 | pub async fn update( |
| 45 | Path(id): Path<i32>, |
| 46 | State(ctx): State<AppContext>, |
| 47 | Json(params): Json<Params>, |
| 48 | ) -> Result<Response> { |
| 49 | let item = load_item(&ctx, id).await?; |
| 50 | let mut item = item.into_active_model(); |
| 51 | params.update(&mut item); |
| 52 | let item = item.update(&ctx.db).await?; |
| 53 | format::json(item) |
| 54 | } |
| 55 | |
| 56 | #[debug_handler] |
| 57 | pub async fn remove(Path(id): Path<i32>, State(ctx): State<AppContext>) -> Result<Response> { |
nothing calls this directly
no test coverage detected