[C++][Pistache] Rename value holder to lower chance of collision with parameter name (#4948)

* [C++][Pistache] Rename value holder to lower chance of collision with parameter name

* [C++][Pistache] Update Petstore sample
This commit is contained in:
Mateusz Szychowski (Muttley)
2020-01-21 00:47:26 +01:00
committed by sunn
parent 2bc3c196e8
commit 6af27d52ca
4 changed files with 16 additions and 16 deletions

View File

@@ -143,17 +143,17 @@ void UserApi::login_user_handler(const Pistache::Rest::Request &request, Pistach
auto usernameQuery = request.query().get("username");
Pistache::Optional<std::string> username;
if(!usernameQuery.isEmpty()){
std::string value;
if(fromStringValue(usernameQuery.get(), value)){
username = Pistache::Some(value);
std::string valueQuery_instance;
if(fromStringValue(usernameQuery.get(), valueQuery_instance)){
username = Pistache::Some(valueQuery_instance);
}
}
auto passwordQuery = request.query().get("password");
Pistache::Optional<std::string> password;
if(!passwordQuery.isEmpty()){
std::string value;
if(fromStringValue(passwordQuery.get(), value)){
password = Pistache::Some(value);
std::string valueQuery_instance;
if(fromStringValue(passwordQuery.get(), valueQuery_instance)){
password = Pistache::Some(valueQuery_instance);
}
}