add decrement replies count on delete note and a test for that
This commit is contained in:
Ehsan Javadynia
2022-03-22 14:48:33 +01:00
committed by GitHub
parent ba9563b983
commit 08bace6c7d
2 changed files with 36 additions and 0 deletions

View File

@ -29,6 +29,10 @@ export default async function(user: User, note: Note, quiet = false) {
Notes.decrement({ id: note.renoteId }, 'score', 1);
}
if (note.replyId) {
await Notes.decrement({ id: note.replyId }, 'repliesCount', 1);
}
if (!quiet) {
publishNoteStream(note.id, 'deleted', {
deletedAt: deletedAt,