Skip to main content

delete

Function delete 

Source
pub async fn delete(
    pool: &PgPool,
    actor: &Actor,
    file_id: Uuid,
) -> AppResult<FileRecord>
Expand description

Removes a file (with all its versions) from an in-work revision. The blobs stay in the vault because other revisions may still reference them.

§Invariants

  • Permission: the file is visible to the actor (“not found” otherwise), its revision is checked out by the actor (409 otherwise) and editable (revisions::ensure_editable: in work, CAD editor of its group).
  • Locks: the revision row (revisions::lock).
  • Audit: file.delete.
  • Notifications / webhooks: none.
  • Atomic: one transaction.