refactor: Remove user associations before removing user

This commit is contained in:
Faruk AYDIN
2024-09-03 16:00:24 +03:00
parent 560407b972
commit 0df5e5283e

View File

@@ -250,6 +250,7 @@ class User extends Base {
}
async softRemove() {
await this.softRemoveAssociations();
await this.$query().delete();
const jobName = `Delete user - ${this.id}`;
@@ -260,7 +261,6 @@ class User extends Base {
};
await deleteUserQueue.add(jobName, jobPayload, jobOptions);
await this.softRemoveAssociations();
}
async softRemoveAssociations() {