From a39dc26216146868c4e512611ef2f1da1cdbd67f Mon Sep 17 00:00:00 2001 From: Mariela Date: Sun, 31 Jul 2022 17:10:15 -0600 Subject: [PATCH 1/7] =?UTF-8?q?elimaci=C3=B3n=20l=C3=B3gica=20en=20usuario?= =?UTF-8?q?s?= 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) { From 86cfcc64cd3bb10ba091bf48e514b3431563e14c Mon Sep 17 00:00:00 2001 From: Mariela Date: Sun, 31 Jul 2022 17:11:23 -0600 Subject: [PATCH 2/7] =?UTF-8?q?eliminaci=C3=B3n=20l=C3=B3gica=20en=20reser?= =?UTF-8?q?vaciones?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/reservations/reservations.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servicio-reservaciones/src/reservations/reservations.service.ts b/servicio-reservaciones/src/reservations/reservations.service.ts index 8a681cd3..45382f50 100644 --- a/servicio-reservaciones/src/reservations/reservations.service.ts +++ b/servicio-reservaciones/src/reservations/reservations.service.ts @@ -41,6 +41,8 @@ export class ReservationsService { } async remove(id: string) { - return this.reservationModel.findByIdAndRemove({ _id: id }).exec(); + return this.reservationModel.findOneAndUpdate({ _id: id }, {status: '-1'}, { + new: true, + }); } } From 95d5a5dd0fa99b4449809c6fe051d17e150664fc Mon Sep 17 00:00:00 2001 From: Mariela Date: Sun, 31 Jul 2022 17:16:40 -0600 Subject: [PATCH 3/7] =?UTF-8?q?eliminaci=C3=B3n=20l=C3=B3gica=20en=20repor?= =?UTF-8?q?tes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- servicio-reportes/src/reports/reports.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/servicio-reportes/src/reports/reports.service.ts b/servicio-reportes/src/reports/reports.service.ts index 37a68957..73bc7330 100644 --- a/servicio-reportes/src/reports/reports.service.ts +++ b/servicio-reportes/src/reports/reports.service.ts @@ -31,6 +31,9 @@ export class ReportsService { } async remove(id: string) { - return this.reportModel.findByIdAndRemove({ _id: id }).exec(); + return this.reportModel.findOneAndUpdate({ _id: id }, {status: '-1'}, { + new: true, + }); + } } From 91ac92719a867ea425b62c6f08fb1c0525bd9405 Mon Sep 17 00:00:00 2001 From: Mariela Date: Sun, 31 Jul 2022 17:17:25 -0600 Subject: [PATCH 4/7] =?UTF-8?q?eliminaci=C3=B3n=20l=C3=B3gica=20en=20invit?= =?UTF-8?q?ados?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- servicio-invitados/src/guests/guests.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servicio-invitados/src/guests/guests.service.ts b/servicio-invitados/src/guests/guests.service.ts index 97e1c4bd..02379936 100644 --- a/servicio-invitados/src/guests/guests.service.ts +++ b/servicio-invitados/src/guests/guests.service.ts @@ -32,6 +32,8 @@ export class GuestsService { } async remove(id: string) { - return this.guestModel.findByIdAndRemove({ _id: id }).exec(); + return this.guestModel.findOneAndUpdate({ _id: id }, {status: '-1'}, { + new: true, + }); } } From 14df451c0a0be79e6678e499f946c37f6d91b584 Mon Sep 17 00:00:00 2001 From: Mariela Date: Sun, 31 Jul 2022 17:18:13 -0600 Subject: [PATCH 5/7] =?UTF-8?q?eliminaci=C3=B3n=20l=C3=B3gica=20en=20foro?= =?UTF-8?q?=20comunicados?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/post-comments/post-comments.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servicio-foro-comunicaciones/src/post-comments/post-comments.service.ts b/servicio-foro-comunicaciones/src/post-comments/post-comments.service.ts index 4b8a0c0a..f82b71fa 100644 --- a/servicio-foro-comunicaciones/src/post-comments/post-comments.service.ts +++ b/servicio-foro-comunicaciones/src/post-comments/post-comments.service.ts @@ -33,6 +33,8 @@ export class PostCommentsService { } async remove(id: string) { - return this.commentModel.findByIdAndRemove({ _id: id }).exec(); + return this.commentModel.findOneAndUpdate({ _id: id }, {status: '-1'}, { + new: true, + }); } } From 2519136654143fcebb711be6cfc23deab39a7013 Mon Sep 17 00:00:00 2001 From: Mariela Date: Sun, 31 Jul 2022 17:18:56 -0600 Subject: [PATCH 6/7] =?UTF-8?q?eliminaci=C3=B3n=20l=C3=B3gica=20en=20comun?= =?UTF-8?q?idades?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/communities/communities.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servicio-comunidad-viviendas/src/communities/communities.service.ts b/servicio-comunidad-viviendas/src/communities/communities.service.ts index 06792ef5..69cd9f24 100644 --- a/servicio-comunidad-viviendas/src/communities/communities.service.ts +++ b/servicio-comunidad-viviendas/src/communities/communities.service.ts @@ -56,7 +56,9 @@ export class CommunitiesService { } async remove(id: string) { - return this.communityModel.findByIdAndRemove({ _id: id }).exec(); + return this.communityModel.findOneAndUpdate({ _id: id }, {status: '-1'}, { + new: true, + }); } async findCommunityAdmin(community: string, user_type: string) { From 17941893cbb5e3e01e8c523c6c1ba38981287776 Mon Sep 17 00:00:00 2001 From: Mariela Date: Sun, 31 Jul 2022 17:19:23 -0600 Subject: [PATCH 7/7] =?UTF-8?q?eliminaci=C3=B3n=20l=C3=B3gica=20en=20?= =?UTF-8?q?=C3=A1reas=20comunes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/common_areas/common_areas.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servicio-areas-comunes/src/common_areas/common_areas.service.ts b/servicio-areas-comunes/src/common_areas/common_areas.service.ts index a632a829..325a9821 100644 --- a/servicio-areas-comunes/src/common_areas/common_areas.service.ts +++ b/servicio-areas-comunes/src/common_areas/common_areas.service.ts @@ -32,6 +32,8 @@ export class CommonAreasService { } async remove(id: string) { - return this.commonAreaModel.findByIdAndRemove({ _id: id }).exec(); + return this.commonAreaModel.findOneAndUpdate({ _id: id }, {status: '-1'}, { + new: true, + }); } }