Skip to main content

add

Function add 

Source
pub async fn add(
    pool: &PgPool,
    actor: &Actor,
    from_revision_id: Uuid,
    input: NewReference,
) -> AppResult<ItemReference>
Expand description

Adds a reference to a revision that is checked out by the actor.

§Invariants

  • Permission: the target item is visible to the actor (“not found” otherwise); the revision is visible, checked out by the actor (409 otherwise) and editable (revisions::ensure_editable: in work, CAD editor of its group). An item cannot reference itself (400).
  • Locks: the revision row (revisions::lock).
  • Audit: reference.add.
  • Notifications / webhooks: none.
  • Atomic: one transaction; a duplicate reference (unique key) is a 409.