fix: Correct user on documents in deleted collection (#6116)

This commit is contained in:
Tom Moor
2023-11-05 09:43:38 -05:00
committed by GitHub
parent c76aa845f4
commit 7c319c17c6
4 changed files with 26 additions and 38 deletions

View File

@@ -20,7 +20,6 @@ import {
Default,
BeforeValidate,
BeforeSave,
AfterDestroy,
AfterCreate,
HasMany,
BelongsToMany,
@@ -279,18 +278,6 @@ class Collection extends ParanoidModel {
}
}
@AfterDestroy
static async onAfterDestroy(model: Collection) {
await Document.destroy({
where: {
collectionId: model.id,
archivedAt: {
[Op.is]: null,
},
},
});
}
@AfterCreate
static async onAfterCreate(
model: Collection,