comparison OrthancServer/OrthancRestApi/OrthancRestModalities.cpp @ 812:8a36c947490c

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 08 May 2014 14:51:49 +0200
parents 401a9633e492
children b640aeee11ba
comparison
equal deleted inserted replaced
811:78b9f64b6b7b 812:8a36c947490c
470 Json::Reader reader; 470 Json::Reader reader;
471 if (reader.parse(call.GetPutBody(), json)) 471 if (reader.parse(call.GetPutBody(), json))
472 { 472 {
473 RemoteModalityParameters modality; 473 RemoteModalityParameters modality;
474 modality.FromJson(json); 474 modality.FromJson(json);
475 modality.SetName(call.GetUriComponent("id", "")); 475 Configuration::UpdateModality(call.GetUriComponent("id", ""), modality);
476 Configuration::UpdateModality(modality);
477 } 476 }
478 } 477 }
479 478
480 479
481 static void DeleteModality(RestApi::DeleteCall& call) 480 static void DeleteModality(RestApi::DeleteCall& call)
490 Json::Reader reader; 489 Json::Reader reader;
491 if (reader.parse(call.GetPutBody(), json)) 490 if (reader.parse(call.GetPutBody(), json))
492 { 491 {
493 OrthancPeerParameters peer; 492 OrthancPeerParameters peer;
494 peer.FromJson(json); 493 peer.FromJson(json);
495 peer.SetName(call.GetUriComponent("id", "")); 494 Configuration::UpdatePeer(call.GetUriComponent("id", ""), peer);
496 Configuration::UpdatePeer(peer);
497 } 495 }
498 } 496 }
499 497
500 498
501 static void DeletePeer(RestApi::DeleteCall& call) 499 static void DeletePeer(RestApi::DeleteCall& call)