auth
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Injectable, NotFoundException, BadRequestException } from '@nestjs/common';
|
||||
import { RequiredEntityData } from '@mikro-orm/core';
|
||||
import { RequiredEntityData } from '@mikro-orm/core';
|
||||
import { User } from '../entities/user.entity';
|
||||
import { UserAddress } from '../entities/user-address.entity';
|
||||
import { EntityManager } from '@mikro-orm/postgresql';
|
||||
@@ -17,7 +17,7 @@ export class UserService {
|
||||
private readonly em: EntityManager,
|
||||
) { }
|
||||
|
||||
async create(dto: CreateUserDto): Promise<User> {
|
||||
async getOrCreate(dto: CreateUserDto): Promise<User> {
|
||||
const normalizedPhone = normalizePhone(dto.phone)
|
||||
|
||||
const currentUser = await this.userRepository.findOne({ phone: normalizedPhone });
|
||||
|
||||
Reference in New Issue
Block a user