merge: Experimental improvements to Delete Account process (maybe resolves #1035) (!1021)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1021

Closes #1035

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
Hazelnoot 2025-05-15 13:00:47 +00:00
commit a2a38c78db
3 changed files with 240 additions and 60 deletions

View file

@ -308,9 +308,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,
});