Skip to main content

withdraw

Function withdraw 

Source
pub async fn withdraw(
    pool: &PgPool,
    actor: &Actor,
    change_id: Uuid,
) -> AppResult<Change>
Expand description

Pulls a change back from review into draft.

ยงInvariants

  • Permission: CAD editor who is the author (or an administrator, or a manager of every affected group while the author is deactivated); the change is in review (409).
  • Locks: the change row (FOR UPDATE), then every revision (revisions::lock) before its state changes.
  • Audit: change.withdraw.
  • Notifications: author, reviewers and watchers of the change, except the actor.
  • Webhooks: none.
  • Data: the revisions go back to in work and all reviews are reset to pending.
  • Atomic: one transaction.