允许userService进行or查询
This commit is contained in:
@@ -3,6 +3,8 @@ import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { User } from './user.entity';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
type UserFindOptions = Partial<Pick<User, 'userId' | 'username' | 'phone' | 'email'>>;
|
||||
|
||||
@Injectable()
|
||||
export class UserService {
|
||||
constructor(
|
||||
@@ -10,7 +12,7 @@ export class UserService {
|
||||
private readonly userRepository: Repository<User>,
|
||||
) { }
|
||||
|
||||
async findOne(options: Partial<Pick<User, 'userId' | 'username' | 'phone' | 'email'>>): Promise<User | null> {
|
||||
async findOne(options: UserFindOptions | UserFindOptions[]): Promise<User | null> {
|
||||
if (Object.keys(options).length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user