parent
bc3ae901cc
commit
329f055a97
7 changed files with 90 additions and 18 deletions
|
|
@ -1,9 +1,7 @@
|
|||
import bcrypt from 'bcryptjs';
|
||||
import define from '../../define.js';
|
||||
import { UserProfiles, Users } from '@/models/index.js';
|
||||
import { doPostSuspend } from '@/services/suspend-user.js';
|
||||
import { publishUserEvent } from '@/services/stream.js';
|
||||
import { createDeleteAccountJob } from '@/queue/index.js';
|
||||
import { deleteAccount } from '@/services/delete-account.js';
|
||||
import define from '../../define.js';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
|
|
@ -34,17 +32,5 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||
throw new Error('incorrect password');
|
||||
}
|
||||
|
||||
// 物理削除する前にDelete activityを送信する
|
||||
await doPostSuspend(user).catch(e => {});
|
||||
|
||||
createDeleteAccountJob(user, {
|
||||
soft: false,
|
||||
});
|
||||
|
||||
await Users.update(user.id, {
|
||||
isDeleted: true,
|
||||
});
|
||||
|
||||
// Terminate streaming
|
||||
publishUserEvent(user.id, 'terminate', {});
|
||||
await deleteAccount(user);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue