minor changes

This commit is contained in:
Tina_Azure
2023-04-19 02:11:59 +02:00
parent ab2229dd8a
commit 9e0eb83eba
3 changed files with 9 additions and 5 deletions

View File

@ -340,7 +340,7 @@ namespace Database {
* parses it fully and returns a JSON containing it at the top or below a variable
* takes the result and optionally a name for the top level variable
*/
crow::json::wvalue convertResultToJSON(pqxx::result &result, std::string jsonName = ""){
crow::json::wvalue convertResultToJSON(pqxx::result &result, std::string jsonName){
std::vector<crow::json::wvalue> jsonVector;
for (int row = 0; row < result.size(); ++row) {
crow::json::wvalue jsonVectorItem;
@ -350,7 +350,7 @@ namespace Database {
jsonVector.push_back(jsonVectorItem);
}
crow::json::wvalue returnJson;
if (jsonName != ""){
if (!jsonName.empty()){
returnJson[jsonName] = crow::json::wvalue(jsonVector);
}
else