elimación lógica en usuarios

This commit is contained in:
Mariela 2022-07-31 17:10:15 -06:00
parent 437a092920
commit a39dc26216
1 changed files with 10 additions and 2 deletions

View File

@ -76,8 +76,14 @@ export class UsersService {
});
}
async remove(id: string) {
/* async remove(id: string) {
return this.userModel.findByIdAndRemove({ _id: id }).exec();
}*/
async remove(id: string) {
return this.userModel.findOneAndUpdate({ _id: id }, {status: '-1'}, {
new: true,
});
}
//inicio de sesion
@ -142,7 +148,9 @@ export class UsersService {
}
async deleteAdminSystem(id: string) {
return this.userModel.deleteOne({ _id: id }).exec();
return this.userModel.findOneAndUpdate({ _id: id }, {status: '-1'}, {
new: true,
});
}
async validateEmail(email: string) {