Mercurial > hg > orthanc
comparison OrthancServer/OrthancRestApi/OrthancRestApi.cpp @ 2966:10c610e80b15
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 05 Dec 2018 15:27:01 +0100 |
parents | 9c0b0a6d8b54 |
children | eea66afed0db |
comparison
equal
deleted
inserted
replaced
2965:9c0b0a6d8b54 | 2966:10c610e80b15 |
---|---|
174 static const char* KEY_SYNCHRONOUS = "Synchronous"; | 174 static const char* KEY_SYNCHRONOUS = "Synchronous"; |
175 static const char* KEY_ASYNCHRONOUS = "Asynchronous"; | 175 static const char* KEY_ASYNCHRONOUS = "Asynchronous"; |
176 | 176 |
177 | 177 |
178 bool OrthancRestApi::IsSynchronousJobRequest(bool isDefaultSynchronous, | 178 bool OrthancRestApi::IsSynchronousJobRequest(bool isDefaultSynchronous, |
179 const Json::Value& body) const | 179 const Json::Value& body) |
180 { | 180 { |
181 if (body.isMember(KEY_SYNCHRONOUS)) | 181 if (body.type() != Json::objectValue) |
182 { | |
183 return isDefaultSynchronous; | |
184 } | |
185 else if (body.isMember(KEY_SYNCHRONOUS)) | |
182 { | 186 { |
183 return SerializationToolbox::ReadBoolean(body, KEY_SYNCHRONOUS); | 187 return SerializationToolbox::ReadBoolean(body, KEY_SYNCHRONOUS); |
184 } | 188 } |
185 else if (body.isMember(KEY_ASYNCHRONOUS)) | 189 else if (body.isMember(KEY_ASYNCHRONOUS)) |
186 { | 190 { |