From 7032527919c813dd9c77eb420b0eaf44485a8b61 Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 21 Oct 2016 21:51:46 +0200 Subject: [PATCH] Fixed bug in cached dashboard data --- .../Controllers/RankOneApiController.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/RankOne.SEO.Tool/Controllers/RankOneApiController.cs b/src/RankOne.SEO.Tool/Controllers/RankOneApiController.cs index 92ac47f..8ca9518 100644 --- a/src/RankOne.SEO.Tool/Controllers/RankOneApiController.cs +++ b/src/RankOne.SEO.Tool/Controllers/RankOneApiController.cs @@ -114,10 +114,14 @@ private void GetPageScores(IEnumerable nodeHierarchy) { foreach (var node in nodeHierarchy) { - if (node.NodeInformation.TemplateId > 0 || node.HasChildrenWithTemplate) + var nodeReport = _nodeReportRepository.GetById(node.NodeInformation.Id); + if (nodeReport != null) { - var nodeReport = _nodeReportRepository.GetById(node.NodeInformation.Id); - if (nodeReport != null) + if (node.NodeInformation.TemplateId == 0) + { + _nodeReportRepository.Delete(nodeReport); + } + if (node.NodeInformation.TemplateId > 0 || node.HasChildrenWithTemplate) { node.FocusKeyword = nodeReport.FocusKeyword; try @@ -155,7 +159,7 @@ private List GetHierarchy(IEnumerable nodeColle var nodeHiearchyCollection = new List(); foreach (var node in nodeCollection) { - + var nodeHierarchy = new HiearchyNode { NodeInformation = new NodeInformation