我有一个关于Nestjs自定义存储库的小问题。
当请求进来时,我有以下逻辑(例如,用于用户实体)。
用户请求的控制器 - >服务 - >存储库调用自定义功能。
因此,我有以下存储库:
我在服务类中注入存储库
并在模块文件中注册
但是当调用注册功能时,我会出现错误:
我进行了研究,还尝试在服务中添加@InjectRepository(userRepository),但是它不起作用
环境:
- 节点:16.13.0
- @nestjs/typeorm”:“^8.1.4”,
- typeorm:“^0.3.7”
- Nestjs:8.2.8
预先感谢
I have a small question about custom repositories in nestjs.
I have the following logic when a request comes in (for example for user entity).
A controller for the user requests -> service -> repository calls custom function.
So i have the following repository:

I inject the repository in service class

And register in module file

But when calling signup function I got error:

I did research and also try to add @InjectRepository(UserRepository) in service but it sill not work
Environments:
- node: 16.13.0
- @nestjs/typeorm": "^8.1.4",
- typeorm: "^0.3.7"
- nestjs: 8.2.8
Thank in advance
发布评论
评论(1)
在 baseerpository >
try BaseRepository in typeorm-transactional-cls-hooked