Fix org user no-data errors, and typo

This commit is contained in:
Ben Goldsworthy 2020-11-29 16:31:21 +00:00
parent 2aa42fa291
commit 688b54dc7f
2 changed files with 10 additions and 8 deletions

View file

@ -85,7 +85,7 @@
<div class="card-block"> <div class="card-block">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h4 class="card-title float-left mb-0"> Global Puchases by Category</h4> <h4 class="card-title float-left mb-0"> Global Purchases by Category</h4>
</div> </div>
<div class="col-12"> <div class="col-12">
<div class="chart-wrapper"> <div class="chart-wrapper">

View file

@ -266,6 +266,7 @@ export class DashboardComponent {
this.setDate(); this.setDate();
this.api.orgStats().subscribe( this.api.orgStats().subscribe(
result => { result => {
if (result.data.cat_list.length > 0) {
this.setWeekPurchaseList(result.weeks); this.setWeekPurchaseList(result.weeks);
this.setWeekData(result); this.setWeekData(result);
this.setChartDataCat(result.data.cat_total); this.setChartDataCat(result.data.cat_total);
@ -274,6 +275,7 @@ export class DashboardComponent {
if (this.totalCategoryList) { if (this.totalCategoryList) {
this.showTotalCategoryList = true; this.showTotalCategoryList = true;
} }
}
}, },
error => { error => {
console.log('Retrieval Error'); console.log('Retrieval Error');