chore: add danak services and admin login
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { Injectable } from "@nestjs/common";
|
||||
import { InjectRepository } from "@nestjs/typeorm";
|
||||
import { Repository } from "typeorm";
|
||||
|
||||
import { User } from "../entities/user.entity";
|
||||
|
||||
@Injectable()
|
||||
export class UserRepository extends Repository<User> {
|
||||
constructor(@InjectRepository(User) userRepository: Repository<User>) {
|
||||
super(userRepository.target, userRepository.manager, userRepository.queryRunner);
|
||||
}
|
||||
|
||||
async findOneWithEmail(email: string): Promise<User | null> {
|
||||
return this.findOneBy({
|
||||
email,
|
||||
});
|
||||
}
|
||||
|
||||
async findOneWithPhone(phone: string): Promise<User | null> {
|
||||
return this.findOneBy({
|
||||
phone,
|
||||
});
|
||||
}
|
||||
|
||||
async findOneWithUserName(userName: string): Promise<User | null> {
|
||||
return this.findOneBy({
|
||||
userName,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user