agregar funciones en servicio de usuarios
This commit is contained in:
parent
ca19da1d19
commit
e2f0b401c5
|
@ -118,5 +118,10 @@ export class UsersController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
@MessagePattern({ cmd: 'changeStatus' })
|
||||
changeStatus(@Payload() body: string) {
|
||||
let pid = body['id'];
|
||||
let pstatus = body['status'];
|
||||
return this.userService.changeStatus(pid, pstatus);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,5 +223,10 @@ export class UsersService {
|
|||
return num_house;
|
||||
}
|
||||
|
||||
async changeStatus(id: string, status: string) {
|
||||
return this.userModel.findOneAndUpdate({ _id: id }, {status: status}, {
|
||||
new: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue