add API method to erase a revision #4662

This commit is contained in:
zadam 2024-03-03 06:34:43 +01:00
parent 9565b0b43d
commit 0ad337c8e8

View File

@ -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();