物理削除系の処理を削除

これらの処理はパフォーマンス的に現実的でないし、すべてのモデルの関係を把握している必要があり保守が困難
論理削除でなんとかする
This commit is contained in:
syuilo
2018-10-29 21:06:23 +09:00
parent d64dc45899
commit 108dcb3e61
20 changed files with 12 additions and 779 deletions

View File

@@ -28,33 +28,6 @@ export type IFollowRequest = {
}
};
/**
* FollowRequestを物理削除します
*/
export async function deleteFollowRequest(followRequest: string | mongo.ObjectID | IFollowRequest) {
let f: IFollowRequest;
// Populate
if (isObjectId(followRequest)) {
f = await FollowRequest.findOne({
_id: followRequest
});
} else if (typeof followRequest === 'string') {
f = await FollowRequest.findOne({
_id: new mongo.ObjectID(followRequest)
});
} else {
f = followRequest as IFollowRequest;
}
if (f == null) return;
// このFollowingを削除
await FollowRequest.remove({
_id: f._id
});
}
/**
* Pack a request for API response
*/