add reset function to user service
This commit is contained in:
parent
8131d1c9fe
commit
d13bdb5dd1
|
@ -72,6 +72,14 @@ export class UsersService {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async resetUserPassword(user: UserDocument){
|
||||||
|
let passwordEncriptada = Md5.init(user.password);
|
||||||
|
user.password = passwordEncriptada;
|
||||||
|
return this.userModel.findOneAndUpdate({ _id: user._id }, { password: passwordEncriptada }, {
|
||||||
|
new: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async findCommunity(community_id: string) {
|
async findCommunity(community_id: string) {
|
||||||
const pattern = { cmd: 'findOneCommunity' }
|
const pattern = { cmd: 'findOneCommunity' }
|
||||||
const payload = { _id: community_id }
|
const payload = { _id: community_id }
|
||||||
|
|
Loading…
Reference in New Issue