I have 2 modules Users & Products, the entity user has one to many relation with products, when user create a product, i have an interceptor that grabs the id of the user from the request, search user in the db by id and attach it to the request but I'm getting the following error:
do i import the users repository in my products module or do i put it in the providers, what if the user module will have other relations with different entities, will i have to import the repository on every module that needs it?
#communication between 2 modules (Users & Products)
4 messages · Page 1 of 1 (latest)
or do i import the whole users module in products module?
I exported users repository in users module then i imported the users module in my products module, someone tell me if this is the right approach please
This is exactly right. By exporting the repository and importing the module, the exported repository is now made available to the module that is doing the importing, and the repository class will not get recreated