From 608ab207e64aa86a48ba1d4c155e0c2301cb7390 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 15 Apr 2015 14:03:29 -0600 Subject: [PATCH] Fixing Issue [https://github.com/TeamMentor/TM_4_0_Design/issues/697] --- src/api/Data-API.coffee | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api/Data-API.coffee b/src/api/Data-API.coffee index 8f7eb0e..d5ff277 100644 --- a/src/api/Data-API.coffee +++ b/src/api/Data-API.coffee @@ -14,8 +14,12 @@ class Data_API extends Swagger_GraphDB cache_Key = "article_#{ref}.json" @.open_Import_Service res, cache_Key, (import_Service)=> import_Service.graph_Find.find_Article ref, (article_Id)=> - data = { article_Id: article_Id} - @close_Import_Service_and_Send import_Service, res, data, cache_Key + if (article_Id?) + data = { article_Id: article_Id} + @close_Import_Service_and_Send import_Service, res, data, cache_Key + else + import_Service.graph.closeDb => + res.send data?.json_pretty() articles: (req,res)=> cache_Key = 'articles.json'