forked from Ynov/ptitspas-ynov-back
added findOneBy method in user service
This commit is contained in:
parent
a7fcbf2600
commit
b926bb143d
@ -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 } });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user