diff --git a/src/app/dataset-detail/components/dataset-api/resources-queryable/resource-queryable/resource-queryable.component.ts b/src/app/dataset-detail/components/dataset-api/resources-queryable/resource-queryable/resource-queryable.component.ts index 0a57279dd22c34bd0e599856ecbf2fa19fef7b67..71ac7460215f86041459346f25e37024a56bc534 100644 --- a/src/app/dataset-detail/components/dataset-api/resources-queryable/resource-queryable/resource-queryable.component.ts +++ b/src/app/dataset-detail/components/dataset-api/resources-queryable/resource-queryable/resource-queryable.component.ts @@ -152,13 +152,22 @@ export class ResourceQueryableComponent implements OnInit { this.initSettings(); } + initInseeLabel(datasetData) { + const properties = Object.keys(datasetData[0].properties); + this.inseeLabel = properties.find((prop) => { return prop.includes('insee'); }); + } + initURLCustomization() { this.projectionList = []; // Set the insee property label for this dataset if (this._datasetDetailService.datasetData[0]) { - const properties = Object.keys(this._datasetDetailService.datasetData[0].properties); - this.inseeLabel = properties.find((prop) => { return prop.includes('insee'); }); + this.initInseeLabel(this._datasetDetailService.datasetData); + } + else { + this._datasetDetailService.retrieveDatasetData().subscribe(()=>{ + this.initInseeLabel(this._datasetDetailService.datasetData); + }); } this.selectedFormat = this.resource.formats[0];