forked from Ynov/ptitspas-ynov-back
added findOneBy method in user service
This commit is contained in:
@@ -47,6 +47,10 @@ export class UserService {
|
||||
return this.usersRepository.find();
|
||||
}
|
||||
|
||||
async findOneBy(where: Partial<Users>) {
|
||||
return this.usersRepository.findOne( { where } )
|
||||
}
|
||||
|
||||
//Trouver utilisateur par ID
|
||||
async findOne(id: string): Promise<Users> {
|
||||
const user = await this.usersRepository.findOne({ where: { id } });
|
||||
|
||||
Reference in New Issue
Block a user