feat: add user createOne and refactor code

This commit is contained in:
2026-02-23 09:19:34 +03:30
parent 72a001a150
commit 63b4567166
13 changed files with 192 additions and 110 deletions
+2 -3
View File
@@ -2,7 +2,6 @@ import { Injectable, RequestTimeoutException } from '@nestjs/common';
import { Repository } from 'typeorm';
import { User } from '../user.entity';
import { InjectRepository } from '@nestjs/typeorm';
import { CreateUserDTO } from '../dto/create-user.dto';
@Injectable()
export class UsersService {
@@ -25,8 +24,8 @@ export class UsersService {
}
}
public async createOne(createUserDto: CreateUserDTO) {
const newUser = this.userRepository.create(createUserDto);
public async createOne(phone: string) {
const newUser = this.userRepository.create({ phone });
try {
await this.userRepository.save(newUser);