diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-05-11 00:05:52 -0400 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-05-12 21:38:11 -0400 |
| commit | a8a8c41a9b7db8b1c0f7a3b7ce4ffb56cf66d981 (patch) | |
| tree | 6f3e4b29db4e7240afb2873b24de362a5234b9d1 | |
| parent | await delete account in queue in case of errors (diff) | |
| download | sharkey-a8a8c41a9b7db8b1c0f7a3b7ce4ffb56cf66d981.tar.gz sharkey-a8a8c41a9b7db8b1c0f7a3b7ce4ffb56cf66d981.tar.bz2 sharkey-a8a8c41a9b7db8b1c0f7a3b7ce4ffb56cf66d981.zip | |
allow caller to pass in existing reaction hint to ReactionService.delete
| -rw-r--r-- | packages/backend/src/core/ReactionService.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/backend/src/core/ReactionService.ts b/packages/backend/src/core/ReactionService.ts index 0179b0680f..776dec7490 100644 --- a/packages/backend/src/core/ReactionService.ts +++ b/packages/backend/src/core/ReactionService.ts @@ -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, }); |