Skip to content

Commit

Permalink
Merge pull request #95 from beabee-communityrm/fix/permanently-delete
Browse files Browse the repository at this point in the history
fix: permanently delete contacts not clearing everything
  • Loading branch information
wpf500 committed Nov 26, 2024
1 parent f14fd57 commit 6bbdcff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/core/src/services/CalloutsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,11 @@ class CalloutsService {
{ contactId: contact.id },
{ contactId: null }
);

await getRepository(CalloutResponse).update(
{ assigneeId: contact.id },
{ assigneeId: null }
);
}

/**
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/services/ContactsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
Contact,
ContactProfile,
ContactRole,
ContactTagAssignment,
GiftFlow,
Password,
Project,
Expand Down Expand Up @@ -421,6 +422,9 @@ class ContactsService {
.getRepository(GiftFlow)
.update({ gifteeId: contact.id }, { gifteeId: null });

await em
.getRepository(ContactTagAssignment)
.delete({ contactId: contact.id });
await em.getRepository(ContactRole).delete({ contactId: contact.id });
await em.getRepository(ContactProfile).delete({ contactId: contact.id });
await em.getRepository(Contact).delete(contact.id);
Expand Down

0 comments on commit 6bbdcff

Please sign in to comment.