Merge remote-tracking branch 'origin/dev' into US-28-EliminarÁreaComún

This commit is contained in:
Mariela 2022-08-01 01:24:43 -06:00
commit 443b09e8e3
6 changed files with 26 additions and 7 deletions

View File

@ -56,7 +56,9 @@ export class CommunitiesService {
} }
async remove(id: string) { 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) { async findCommunityAdmin(community: string, user_type: string) {

View File

@ -33,6 +33,8 @@ export class PostCommentsService {
} }
async remove(id: string) { async remove(id: string) {
return this.commentModel.findByIdAndRemove({ _id: id }).exec(); return this.commentModel.findOneAndUpdate({ _id: id }, {status: '-1'}, {
new: true,
});
} }
} }

View File

@ -32,6 +32,8 @@ export class GuestsService {
} }
async remove(id: string) { async remove(id: string) {
return this.guestModel.findByIdAndRemove({ _id: id }).exec(); return this.guestModel.findOneAndUpdate({ _id: id }, {status: '-1'}, {
new: true,
});
} }
} }

View File

@ -31,6 +31,9 @@ export class ReportsService {
} }
async remove(id: string) { async remove(id: string) {
return this.reportModel.findByIdAndRemove({ _id: id }).exec(); return this.reportModel.findOneAndUpdate({ _id: id }, {status: '-1'}, {
new: true,
});
} }
} }

View File

@ -41,6 +41,8 @@ export class ReservationsService {
} }
async remove(id: string) { async remove(id: string) {
return this.reservationModel.findByIdAndRemove({ _id: id }).exec(); return this.reservationModel.findOneAndUpdate({ _id: id }, {status: '-1'}, {
new: true,
});
} }
} }

View File

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