From 19a667382af6ef51622bfa55d48ba616372cbb06 Mon Sep 17 00:00:00 2001 From: Ben Goldsworthy Date: Sun, 29 Nov 2020 16:31:21 +0000 Subject: [PATCH] Fix org user no-data errors, and typo --- src/app/dashboard/dashboard.component.html | 2 +- src/app/dashboard/dashboard.component.ts | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html index 9f6c96e..b9f1186 100644 --- a/src/app/dashboard/dashboard.component.html +++ b/src/app/dashboard/dashboard.component.html @@ -85,7 +85,7 @@
-

Global Puchases by Category

+

Global Purchases by Category

diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index 1c6b481..817d40e 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -266,13 +266,15 @@ export class DashboardComponent { this.setDate(); this.api.orgStats().subscribe( result => { - this.setWeekPurchaseList(result.weeks); - this.setWeekData(result); - this.setChartDataCat(result.data.cat_total); - this.setChartDataEssential(result.data.essentials); - this.totalCategoryList = result.data.cat_list; - if (this.totalCategoryList) { - this.showTotalCategoryList = true; + if (result.data.cat_list.length > 0) { + this.setWeekPurchaseList(result.weeks); + this.setWeekData(result); + this.setChartDataCat(result.data.cat_total); + this.setChartDataEssential(result.data.essentials); + this.totalCategoryList = result.data.cat_list; + if (this.totalCategoryList) { + this.showTotalCategoryList = true; + } } }, error => {