1
0

allow caller to pass in existing reaction hint to ReactionService.delete

This commit is contained in:
Hazelnoot
2025-05-11 00:05:52 -04:00
parent fe5def9de0
commit a8a8c41a9b
+2 -2
View File
@@ -298,9 +298,9 @@ export class ReactionService {
}
@bindThis
public async delete(user: { id: MiUser['id']; host: MiUser['host']; isBot: MiUser['isBot']; }, note: MiNote) {
public async delete(user: { id: MiUser['id']; host: MiUser['host']; isBot: MiUser['isBot']; }, note: MiNote, exist?: MiNoteReaction | null) {
// if already unreacted
const exist = await this.noteReactionsRepository.findOneBy({
exist ??= await this.noteReactionsRepository.findOneBy({
noteId: note.id,
userId: user.id,
});