needle-innovision / nestjs-tenancy

Multi-tenancy approach for nestjs - currently supported only for mongodb with mongoose
MIT License
186 stars 58 forks source link

Event Emitter Support #40

Closed gorkemyontem closed 1 year ago

gorkemyontem commented 1 year ago

Hi there, Is there any way this library works with event driven approach? https://docs.nestjs.com/techniques/events

In the documentation they specifically state that "Event subscribers cannot be request-scoped." and your library is request-scoped. But I just want to make sure that there is a way or not.

Thank you!

sandeepsuvit commented 1 year ago

@gorkemyontem Thanks for writing in.

Currently it is not supported since we derive the tenant information from the request data. But there is a PR for microservices with few modification of the core library methods which i haven't personally tested. You may find some pointers in that. https://github.com/needle-innovision/nestjs-tenancy/pull/38

gorkemyontem commented 1 year ago

Thank you @sandeepsuvit I'll follow that issue