add find user by roles
This commit is contained in:
@@ -38,6 +38,19 @@ export class UsersService {
|
||||
});
|
||||
}
|
||||
|
||||
findByRoles(relationId:string,page:number) {
|
||||
return this.usersRepository.findAndCount({
|
||||
skip: page * 10,
|
||||
take: 10,
|
||||
where:{
|
||||
roles:relationId
|
||||
},
|
||||
order: {
|
||||
updatedAt: 'DESC',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async findOne(id: string) {
|
||||
const coa = await this.coaService.findByUser(id,coaType.WALLET);
|
||||
try {
|
||||
@@ -83,7 +96,7 @@ export class UsersService {
|
||||
}
|
||||
}
|
||||
|
||||
const result = await this.usersRepository.update(id, updateUserDto);
|
||||
// const result = await this.usersRepository.update(id, updateUserDto);
|
||||
|
||||
return this.usersRepository.findOneOrFail(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user