Skip to content

Commit

Permalink
Delete reviewer on callout or contact deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
wpf500 committed Nov 26, 2024
1 parent 9520bf8 commit 5686f84
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 5686f84

Please sign in to comment.