|
@@ -9,6 +9,7 @@ import { body, query } from 'express-validator';
|
|
|
import { isEmail } from 'validator';
|
|
import { isEmail } from 'validator';
|
|
|
|
|
|
|
|
import ExternalUserGroupRelation from '~/features/external-user-group/server/models/external-user-group-relation';
|
|
import ExternalUserGroupRelation from '~/features/external-user-group/server/models/external-user-group-relation';
|
|
|
|
|
+import { deleteAiAssistantOnOwnerDeleted } from '~/features/openai/server/services/delete-ai-assistant-on-owner-deleted';
|
|
|
import { SupportedAction } from '~/interfaces/activity';
|
|
import { SupportedAction } from '~/interfaces/activity';
|
|
|
import { accessTokenParser } from '~/server/middlewares/access-token-parser';
|
|
import { accessTokenParser } from '~/server/middlewares/access-token-parser';
|
|
|
import Activity from '~/server/models/activity';
|
|
import Activity from '~/server/models/activity';
|
|
@@ -809,6 +810,8 @@ module.exports = (crowi) => {
|
|
|
await user.statusDelete();
|
|
await user.statusDelete();
|
|
|
await ExternalAccount.remove({ user });
|
|
await ExternalAccount.remove({ user });
|
|
|
|
|
|
|
|
|
|
+ await deleteAiAssistantOnOwnerDeleted(user);
|
|
|
|
|
+
|
|
|
const serializedUser = serializeUserSecurely(user);
|
|
const serializedUser = serializeUserSecurely(user);
|
|
|
|
|
|
|
|
activityEvent.emit('update', res.locals.activity._id, { action: SupportedAction.ACTION_ADMIN_USERS_REMOVE });
|
|
activityEvent.emit('update', res.locals.activity._id, { action: SupportedAction.ACTION_ADMIN_USERS_REMOVE });
|