diff --git a/src/structures/dto/create-structure.dto.ts b/src/structures/dto/create-structure.dto.ts index 019b210aa4da6a72982a1f56dc1d3568d83f31d4..857697914c2aad758535f706b2e2f0811fb3e2bd 100644 --- a/src/structures/dto/create-structure.dto.ts +++ b/src/structures/dto/create-structure.dto.ts @@ -36,7 +36,7 @@ export class CreateStructureDto { aideALaParentalite: string[]; cultureEtSecuriteNumerique: string[]; wifiEnAccesLibre: boolean; - ordinateurs: boolean; + nbComputers: boolean; nombre: string; tablettes: boolean; bornesNumeriques: boolean; diff --git a/src/structures/schemas/structure.schema.ts b/src/structures/schemas/structure.schema.ts index 821547e9f35edd4d65eb38b2dd10dd3cf3480ad8..711c63714c5c39442ed74f8bf29d333788155755 100644 --- a/src/structures/schemas/structure.schema.ts +++ b/src/structures/schemas/structure.schema.ts @@ -112,22 +112,10 @@ export class Structure { cultureEtSecuriteNumerique: string[]; @Prop() - wifiEnAccesLibre: boolean; + equipementsEtServicesProposes: string[]; @Prop() - ordinateurs: boolean; - - @Prop() - nombre: string; - - @Prop() - tablettes: boolean; - - @Prop() - bornesNumeriques: boolean; - - @Prop() - imprimantes: boolean; + nbComputers: number; @Prop() precisionsSiNecessaire: string; diff --git a/src/structures/structures.controller.ts b/src/structures/structures.controller.ts index 27fa79cc82204ce5f96b3b84249c7e76bd0ee584..b3a33b8aa05b35c191abfef770bb228f2cb3a420 100644 --- a/src/structures/structures.controller.ts +++ b/src/structures/structures.controller.ts @@ -35,11 +35,7 @@ export class StructuresController { this.structureService.countByStructureKey('publicsAcceptes'), this.structureService.countByStructureKey('modalitesDacces'), this.structureService.countByStructureKey('lesCompetencesDeBase'), - this.structureService.countByEquipmentsKey('wifiEnAccesLibre', 'Wifi en accès libre'), - this.structureService.countByEquipmentsKey('ordinateurs', 'Ordinateurs'), - this.structureService.countByEquipmentsKey('tablettes', 'Tablettes'), - this.structureService.countByEquipmentsKey('bornesNumeriques', 'Bornes numériques'), - this.structureService.countByEquipmentsKey('imprimantes', 'Imprimantes'), + this.structureService.countByStructureKey('equipementsEtServicesProposes'), ]); // Return a concat of all arrays return data.reduce((a, b) => [...a, ...b]); diff --git a/src/structures/structures.service.ts b/src/structures/structures.service.ts index 7c9b021980a81598267c22dd013e60f330b946a4..9e52b0937eee1a679ca545a70f2f1400c846a60a 100644 --- a/src/structures/structures.service.ts +++ b/src/structures/structures.service.ts @@ -105,10 +105,6 @@ export class StructuresService { ); } - public async countByEquipmentsKey(key: string, displayKey: string): Promise<any> { - return [{ id: displayKey, count: await this.structureModel.countDocuments({ [key]: true }).exec() }]; - } - public getCoord(numero: string, address: string, zipcode: string): Observable<AxiosResponse<any>> { const req = 'https://download.data.grandlyon.com/geocoding/photon/api' + '?q=' + numero + ' ' + address + ' ' + zipcode;