fix: Allow soft-deleted records to be queried from RevisionProcessor

closes #3706
This commit is contained in:
Tom Moor
2022-07-02 11:58:22 +02:00
parent 1c6eef3509
commit 94824af6e7

View File

@@ -14,7 +14,9 @@ export default class RevisionsProcessor extends BaseProcessor {
switch (event.name) {
case "documents.publish":
case "documents.update.debounced": {
const document = await Document.findByPk(event.documentId);
const document = await Document.findByPk(event.documentId, {
paranoid: false,
});
invariant(document, "Document should exist");
const previous = await Revision.findLatest(document.id);
@@ -28,7 +30,9 @@ export default class RevisionsProcessor extends BaseProcessor {
return;
}
const user = await User.findByPk(event.actorId);
const user = await User.findByPk(event.actorId, {
paranoid: false,
});
invariant(user, "User should exist");
await revisionCreator({
user,