How can I cascade delete with one-to-many relation in typeORM?
10:27 22 Feb 2022

I have group and contact entities in OneToMany relationship. I add contacts within the group. When I want to delete, I want both sides of the database to be deleted. but only the group table is deleted.

here's contact.entity contact.entity

Here's one to many relationship:

here's group.entity group.entity

The function I wrote in the service is as follows: function in the service

I tried many solutions by searching. Adding cascades on both sides, I know this isn't right, but I wanted to try, but I couldn't get it to work.

javascript typescript postgresql nestjs typeorm