fix eliminación lógica

This commit is contained in:
Mariela 2022-08-01 01:07:04 -06:00
parent e59678d689
commit bb05560668
1 changed files with 4 additions and 2 deletions

View File

@ -32,8 +32,10 @@ export class CommonAreasService {
}
async remove(id: string) {
return this.commonAreaModel.findByIdAndRemove({ _id: id }).exec();
}
return this.commonAreaModel.findOneAndUpdate({ _id: id }, {status: '-1'}, {
new: true,
});
};
async findByCommunity(community_id: string): Promise<CommonArea[]> {
return this.commonAreaModel.find({ community_id: community_id }).exec();