mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-02 14:26:28 +02:00
物理削除系の処理を削除
これらの処理はパフォーマンス的に現実的でないし、すべてのモデルの関係を把握している必要があり保守が困難 論理削除でなんとかする
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user