From 41a5d8024e5a3f957a271625208bb9c481a5a6e8 Mon Sep 17 00:00:00 2001 From: Etienne LOUPIAS <eloupias@grandlyon.com> Date: Fri, 3 Jun 2022 12:17:46 +0200 Subject: [PATCH] feat(structure): remove useless server lockdown filter --- src/structures/services/structures.service.ts | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/structures/services/structures.service.ts b/src/structures/services/structures.service.ts index 562d19ce9..09a8fa5d5 100644 --- a/src/structures/services/structures.service.ts +++ b/src/structures/services/structures.service.ts @@ -104,13 +104,7 @@ export class StructuresService { .exec(); } - await structures.sort((a, b) => ids.indexOf(a.id) - ids.indexOf(b.id)); - if (!(await this.parametersService.getParameters()).lockdownInfoDisplay) { - structures.map((structure: StructureDocument) => { - structure.lockdownActivity = ''; - }); - } - return structures; + return await structures.sort((a, b) => ids.indexOf(a.id) - ids.indexOf(b.id)); } public async create(idUser: string, structure: StructureDto): Promise<Structure> { @@ -214,7 +208,7 @@ export class StructuresService { public async findAll(): Promise<StructureDocument[]> { this.logger.debug('findAll'); - let structures = await this.structureModel.find({ deletedAt: { $exists: false } }).exec(); + const structures = await this.structureModel.find({ deletedAt: { $exists: false } }).exec(); // Update structures coord and address before sending them await Promise.all( structures.map((structure: StructureDocument) => { @@ -228,13 +222,7 @@ export class StructuresService { } }) ); - structures = await this.structureModel.find({ deletedAt: { $exists: false }, accountVerified: true }).exec(); - if (!(await this.parametersService.getParameters()).lockdownInfoDisplay) { - await structures.map((structure: StructureDocument) => { - structure.lockdownActivity = ''; - }); - } - return structures; + return await this.structureModel.find({ deletedAt: { $exists: false }, accountVerified: true }).exec(); } public async findAllUnclaimed(): Promise<UnclaimedStructureDto[]> { -- GitLab