Skip to content
Snippets Groups Projects
Commit 3d847f31 authored by Matthieu Benoist's avatar Matthieu Benoist
Browse files

Fix Initialisation problem when API route is called directly

With a direct link to the API tab, the data was not queried, preventing
filtering by insee code.
parent b7ab37c8
No related branches found
No related tags found
1 merge request!75Fixes for some CGU popin and WS tab problems
......@@ -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];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment