From 0ad337c8e806ba84d48d7b97aa46df52d9f236a8 Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 3 Mar 2024 06:34:43 +0100 Subject: [PATCH] add API method to erase a revision #4662 --- src/becca/entities/brevision.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/becca/entities/brevision.js b/src/becca/entities/brevision.js index 841ecaaee3..5a79f3d8f0 100644 --- a/src/becca/entities/brevision.js +++ b/src/becca/entities/brevision.js @@ -161,6 +161,13 @@ class BRevision extends AbstractBeccaEntity { return this.getAttachments().filter(attachment => attachment.title === title)[0]; } + /** + * Revisions are not soft-deletable, they are immediately hard-deleted (erased). + */ + eraseRevision() { + require("../../services/erase.js").eraseRevisions([this.revisionId]); + } + beforeSaving() { super.beforeSaving();