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

Function update

examples/loco_seaography/src/controllers/notes.rs:44–54  ·  view source on GitHub ↗
(
    Path(id): Path<i32>,
    State(ctx): State<AppContext>,
    Json(params): Json<Params>,
)

Source from the content-addressed store, hash-verified

42
43#[debug_handler]
44pub 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]
57pub async fn remove(Path(id): Path<i32>, State(ctx): State<AppContext>) -> Result<Response> {

Callers

nothing calls this directly

Calls 4

jsonFunction · 0.85
into_active_modelMethod · 0.80
load_itemFunction · 0.70
updateMethod · 0.45

Tested by

no test coverage detected