物理削除系の処理を削除

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

View file

@ -33,33 +33,6 @@ export const validateReaction = $.str.or([
'pudding'
]);
/**
* NoteReactionを物理削除します
*/
export async function deleteNoteReaction(noteReaction: string | mongo.ObjectID | INoteReaction) {
let n: INoteReaction;
// Populate
if (isObjectId(noteReaction)) {
n = await NoteReaction.findOne({
_id: noteReaction
});
} else if (typeof noteReaction === 'string') {
n = await NoteReaction.findOne({
_id: new mongo.ObjectID(noteReaction)
});
} else {
n = noteReaction as INoteReaction;
}
if (n == null) return;
// このNoteReactionを削除
await NoteReaction.remove({
_id: n._id
});
}
/**
* Pack a reaction for API response
*/