(ctx: &AppContext, id: i32)
| 21 | } |
| 22 | |
| 23 | async fn load_item(ctx: &AppContext, id: i32) -> Result<Model> { |
| 24 | let item = Entity::find_by_id(id).one(&ctx.db).await?; |
| 25 | item.ok_or_else(|| Error::NotFound) |
| 26 | } |
| 27 | |
| 28 | #[debug_handler] |
| 29 | pub async fn list(State(ctx): State<AppContext>) -> Result<Response> { |