Mercurial > hg > orthanc
diff OrthancServer/OrthancRestApi/OrthancRestModalities.cpp @ 2801:3ee82c7313e7
New events in change callbacks: "UpdatedPeers" and "UpdatedModalities"
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 23 Aug 2018 13:52:54 +0200 |
parents | dc7330089736 |
children | 4ee3a759afea |
line wrap: on
line diff
--- a/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp Thu Aug 23 13:11:48 2018 +0200 +++ b/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp Thu Aug 23 13:52:54 2018 +0200 @@ -957,13 +957,15 @@ static void UpdateModality(RestApiPutCall& call) { + ServerContext& context = OrthancRestApi::GetContext(call); + Json::Value json; Json::Reader reader; if (reader.parse(call.GetBodyData(), call.GetBodyData() + call.GetBodySize(), json)) { RemoteModalityParameters modality; modality.FromJson(json); - Configuration::UpdateModality(call.GetUriComponent("id", ""), modality); + Configuration::UpdateModality(context, call.GetUriComponent("id", ""), modality); call.GetOutput().AnswerBuffer("", "text/plain"); } } @@ -971,20 +973,24 @@ static void DeleteModality(RestApiDeleteCall& call) { - Configuration::RemoveModality(call.GetUriComponent("id", "")); + ServerContext& context = OrthancRestApi::GetContext(call); + + Configuration::RemoveModality(context, call.GetUriComponent("id", "")); call.GetOutput().AnswerBuffer("", "text/plain"); } static void UpdatePeer(RestApiPutCall& call) { + ServerContext& context = OrthancRestApi::GetContext(call); + Json::Value json; Json::Reader reader; if (reader.parse(call.GetBodyData(), call.GetBodyData() + call.GetBodySize(), json)) { WebServiceParameters peer; peer.Unserialize(json); - Configuration::UpdatePeer(call.GetUriComponent("id", ""), peer); + Configuration::UpdatePeer(context, call.GetUriComponent("id", ""), peer); call.GetOutput().AnswerBuffer("", "text/plain"); } } @@ -992,7 +998,9 @@ static void DeletePeer(RestApiDeleteCall& call) { - Configuration::RemovePeer(call.GetUriComponent("id", "")); + ServerContext& context = OrthancRestApi::GetContext(call); + + Configuration::RemovePeer(context, call.GetUriComponent("id", "")); call.GetOutput().AnswerBuffer("", "text/plain"); }