Skip to main content

remove_alternate

Function remove_alternate 

Source
pub async fn remove_alternate(
    pool: &PgPool,
    actor: &Actor,
    item_id: Uuid,
    alternate_item_id: Uuid,
) -> AppResult<u64>
Expand description

Removes the alternate alternate_item_id of item_id – both directions when the actor may also edit the alternate’s group, otherwise only this one. Returns the number of directions removed.

§Invariants

  • Permission: both items visible to the actor (“not found” otherwise); CAD editor and member of the group of item_id (403). The reverse direction is removed only when the actor may also edit the alternate’s group. No such link is “not found”.
  • Locks: none (plain deletes of the link rows).
  • Audit: item.alternate.remove.
  • Notifications / webhooks: none.
  • Atomic: one transaction.