diff --git a/src/users/users.service.ts b/src/users/users.service.ts index bc46e51..cd1c9c0 100644 --- a/src/users/users.service.ts +++ b/src/users/users.service.ts @@ -12,11 +12,7 @@ export class UsersService { constructor(@InjectRepository(User) private readonly usersRepository: Repository) {} create(createUserDto: UsersDTO): Promise { - const user = new User(); - - user.name = createUserDto.name; - user.email = createUserDto.email; - user.password = createUserDto.password; + const user = this.usersRepository.create(createUserDto); return this.usersRepository.save(user); }