diff --git a/packages/core/src/services/CalloutsService.ts b/packages/core/src/services/CalloutsService.ts index 53458100f..df72a8aed 100644 --- a/packages/core/src/services/CalloutsService.ts +++ b/packages/core/src/services/CalloutsService.ts @@ -24,7 +24,8 @@ import { CalloutResponseComment, CalloutResponseTag, CalloutTag, - CalloutVariant + CalloutVariant, + CalloutReviewer } from "#models/index"; import { @@ -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 }); @@ -321,6 +323,7 @@ class CalloutsService { public async permanentlyDeleteContact(contact: Contact): Promise { log.info("Permanently delete callout data for contact " + contact.id); + await getRepository(CalloutReviewer).delete({ contactId: contact.id }); await getRepository(CalloutResponseComment).delete({ contactId: contact.id });