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

Function load_item

examples/loco_example/src/controllers/notes.rs:22–25  ·  view source on GitHub ↗
(ctx: &AppContext, id: i32)

Source from the content-addressed store, hash-verified

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

Callers 3

updateFunction · 0.70
removeFunction · 0.70
get_oneFunction · 0.70

Calls 1

oneMethod · 0.45

Tested by

no test coverage detected