diff OrthancServer/OrthancRestApi/OrthancRestModalities.cpp @ 1063:0332e6e8c679

Fix automated generation of the list of resource children in the REST API
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 25 Jul 2014 16:06:26 +0200
parents bd2cb95003da
children 952cf9b6be83
line wrap: on
line diff
--- a/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp	Fri Jul 25 14:51:18 2014 +0200
+++ b/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp	Fri Jul 25 16:06:26 2014 +0200
@@ -391,9 +391,7 @@
     std::string id = call.GetUriComponent("id", "");
     if (IsExistingPeer(peers, id))
     {
-      Json::Value result = Json::arrayValue;
-      result.append("store");
-      call.GetOutput().AnswerJson(result);
+      RestApi::AutoListChildren(call);
     }
   }
 
@@ -458,15 +456,7 @@
     std::string id = call.GetUriComponent("id", "");
     if (IsExistingModality(modalities, id))
     {
-      Json::Value result = Json::arrayValue;
-      result.append("echo");
-      result.append("find-patient");
-      result.append("find-study");
-      result.append("find-series");
-      result.append("find-instance");
-      result.append("find");
-      result.append("store");
-      call.GetOutput().AnswerJson(result);
+      RestApi::AutoListChildren(call);
     }
   }