Skip to content
Snippets Groups Projects
Commit 1fc49875 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

Merge branch 'refacto/structuresCounter' into 'dev'

refacto(structure) : change model of structure

See merge request web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_server!3
parents 4f31f916 1b65db94
No related branches found
No related tags found
2 merge requests!4Dev,!3refacto(structure) : change model of structure
......@@ -36,7 +36,7 @@ export class CreateStructureDto {
aideALaParentalite: string[];
cultureEtSecuriteNumerique: string[];
wifiEnAccesLibre: boolean;
ordinateurs: boolean;
nbComputers: boolean;
nombre: string;
tablettes: boolean;
bornesNumeriques: boolean;
......
......@@ -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;
......
......@@ -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]);
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment