Skip to main content

update_material

Function update_material 

Source
pub async fn update_material(
    pool: &PgPool,
    actor: &Actor,
    id: Uuid,
    input: MaterialInput,
) -> AppResult<Material>
Expand description

Changes name, density and notes of a material (administrators).

§Invariants

  • Permission: admin role (403 otherwise); validation as create_material; an unknown material is “not found”.
  • Locks: the material row (FOR UPDATE).
  • Audit: material.update with the old and new density.
  • Notifications / webhooks: none.
  • Atomic: one transaction.