Fix invalid graph errors + no data errors

This commit is contained in:
Ben Goldsworthy 2020-11-29 16:29:06 +00:00
parent 83fa5449b8
commit 6168c8e1e2
5 changed files with 34 additions and 27 deletions

View file

@ -109,8 +109,10 @@ export class GraphWidget implements OnInit {
if ( !( this.dataType in DataType ) ) {
console.warn('Unknown DataType for graph \'' + this.graphName + '\' - defaulting to number');
}
this.graphService.getGraph(this.graphName)
.subscribe( result => this.setData(result.graph) );
if (localStorage.getItem('usertype') === 'organisation') {
this.graphService.getGraph(this.graphName)
.subscribe( result => this.setData(result.graph) );
}
}
private setData(data: any) {