Skip to main content

create_material

Function create_material 

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

Adds a material to the library (administrators).

§Invariants

  • Permission: admin role (403 otherwise); name 1–200 characters, density above 0 and at most MAX_DENSITY (400); a name already in the library (case-insensitive) is a 409.
  • Locks: none beyond the unique name index.
  • Audit: material.create.
  • Notifications / webhooks: none.
  • Atomic: one transaction.