If you want to reuse a service/repository in another module…
- Export the service/repository in the origin module
- Import the origin module in the second module
If you want to save a relation along with a parent entity…
- Use the save function from the parent-repo
- Set cascade: true on the manyToMany relationship of the relation on the parent entity (if you do not set this , you have to save the relations first and then only pass the ids)
- Add the complete relation object to the save function (or only the id’s if cascade : false )
Be First to Comment