This commit is contained in:
syuilo
2018-04-12 05:50:45 +09:00
parent 53415e9ba4
commit b846eb8afe
2 changed files with 42 additions and 1 deletions

View File

@ -4,7 +4,7 @@ import rap from '@prezzemolo/rap';
import db from '../db/mongodb';
import Note, { INote, pack as packNote, deleteNote } from './note';
import Following from './following';
import Mute from './mute';
import Mute, { deleteMute } from './mute';
import getFriends from '../server/api/common/get-friends';
import config from '../config';
import AccessToken, { deleteAccessToken } from './access-token';
@ -201,10 +201,24 @@ export async function deleteUser(user: string | mongo.ObjectID | IUser) {
await DriveFolder.find({ userId: u._id })
).map(x => deleteDriveFolder(x)));
// このユーザーのMuteをすべて削除
await Promise.all((
await Mute.find({ muterId: u._id })
).map(x => deleteMute(x)));
// このユーザーへのMuteをすべて削除
await Promise.all((
await Mute.find({ muteeId: u._id })
).map(x => deleteMute(x)));
// このユーザーのFollowingをすべて削除
// このユーザーへのFollowingをすべて削除
// このユーザーのFollowingLogをすべて削除
// このユーザーのFollowedLogをすべて削除
// このユーザーを削除
}