alphamikle / nest_transact

Simplest transactions support for Nestjs with Typeorm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nest-transact doensn't seem to work well with custom repository

puroong opened this issue · comments

commented

Hi, when I try to use it with custom repostiories, I get error saying cannot get undefined of whichever method I tried to call with custom repository

I decorated my custom repository with @entityrepository and imported with TypeOrmModule.forFeature in my module where I declared custom repository

Is there anything more I should do to make it work?

I made repository for reproducing errors here

Hello! I'll figure out what's the reason of this problem in the next weekends.

I very interested about this issue as well :)

In getArgument

    if (typeof param === 'string') {
      ...
    } else {
      try {
        argument = manager.getCustomRepository(param);
      } catch (e) {
        argument = this.findArgumentsForProvider(param as ClassType, manager);
      }
    }

Maybe there is something smarter to test it's a CustomRepository, I tried using CustomRepositoryNotFoundError class but it's not exported by typeorm package...

Hello, @moulinraphael! Version 1.1.2 has the possibility to using custom repositories and some additions too. Enjoy your use! 😃