From a39dc26216146868c4e512611ef2f1da1cdbd67f Mon Sep 17 00:00:00 2001 From: Mariela Date: Sun, 31 Jul 2022 17:10:15 -0600 Subject: [PATCH] =?UTF-8?q?elimaci=C3=B3n=20l=C3=B3gica=20en=20usuarios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- servicio-usuarios/src/users/users.service.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/servicio-usuarios/src/users/users.service.ts b/servicio-usuarios/src/users/users.service.ts index 0fd5a813..725127ab 100644 --- a/servicio-usuarios/src/users/users.service.ts +++ b/servicio-usuarios/src/users/users.service.ts @@ -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) {