|
|
@@ -73,6 +73,7 @@ module.exports = (crowi) => {
|
|
|
User,
|
|
|
Page,
|
|
|
ExternalAccount,
|
|
|
+ UserGroupRelation,
|
|
|
} = crowi.models;
|
|
|
|
|
|
const { ApiV3FormValidator } = crowi.middlewares;
|
|
|
@@ -455,6 +456,7 @@ module.exports = (crowi) => {
|
|
|
|
|
|
try {
|
|
|
const userData = await User.findById(id);
|
|
|
+ await UserGroupRelation.remove({ relatedUser: userData });
|
|
|
await userData.statusDelete();
|
|
|
await ExternalAccount.remove({ user: userData });
|
|
|
await Page.removeByPath(`/user/${userData.username}`);
|