fix: Correct user on documents in deleted collection (#6116)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user