pub async fn delete_material(
pool: &PgPool,
actor: &Actor,
id: Uuid,
) -> AppResult<Material>Expand description
Removes a material from the library (administrators). Revisions keep their material text; their mass is then reported as missing a density.
§Invariants
- Permission: admin role (403 otherwise); an unknown material is “not found”.
- Locks: the material row (
FOR UPDATE). - Audit:
material.delete. - Notifications / webhooks: none.
- Atomic: one transaction.