Skip to content

Commit

Permalink
Merge pull request #97 from beabee-communityrm/fix/delete-reviewer
Browse files Browse the repository at this point in the history
fix: delete reviewer on callout or contact deletion
  • Loading branch information
wpf500 authored Nov 26, 2024
2 parents 9520bf8 + 5686f84 commit c3e499b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/core/src/services/CalloutsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import {
CalloutResponseComment,
CalloutResponseTag,
CalloutTag,
CalloutVariant
CalloutVariant,
CalloutReviewer
} from "#models/index";

import {
Expand Down Expand Up @@ -170,6 +171,7 @@ class CalloutsService {
.setParameters({ id })
.execute();

await em.getRepository(CalloutReviewer).delete({ calloutId: id });
await em.getRepository(CalloutResponse).delete({ calloutId: id });
await em.getRepository(CalloutVariant).delete({ calloutId: id });
await em.getRepository(CalloutTag).delete({ calloutId: id });
Expand Down Expand Up @@ -321,6 +323,7 @@ class CalloutsService {
public async permanentlyDeleteContact(contact: Contact): Promise<void> {
log.info("Permanently delete callout data for contact " + contact.id);

await getRepository(CalloutReviewer).delete({ contactId: contact.id });
await getRepository(CalloutResponseComment).delete({
contactId: contact.id
});
Expand Down

0 comments on commit c3e499b

Please sign in to comment.