We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bda5304 commit a4136d5Copy full SHA for a4136d5
src/users/users.service.ts
@@ -1,6 +1,6 @@
1
import { BadRequestException, Injectable } from '@nestjs/common';
2
import { RegisterUserDto } from '../auth/dto/register-user.dto';
3
-import { EntityRepository } from 'mikro-orm';
+import { EntityManager, EntityRepository } from 'mikro-orm';
4
import { InjectRepository } from 'nestjs-mikro-orm';
5
import { UserEntity } from './user.entity';
6
@@ -9,9 +9,11 @@ export class UsersService {
9
constructor(
10
@InjectRepository(UserEntity)
11
private readonly usersRepository: EntityRepository<UserEntity>,
12
+ private readonly em: EntityManager,
13
) {}
14
15
async findUserById(userId: number) {
16
+ this.em.clear();
17
return this.usersRepository.findOne(userId);
18
}
19
0 commit comments