From 9e0eb83eba3c480e92af8e873b893b25de0e86f5 Mon Sep 17 00:00:00 2001 From: Tina_Azure <-> Date: Wed, 19 Apr 2023 02:11:59 +0200 Subject: [PATCH] minor changes --- src/database.cpp | 4 ++-- src/main.cpp | 7 ++++--- templates/customerIndex_FreelancerListing.html | 3 +++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/database.cpp b/src/database.cpp index 90d9d5d..6db865e 100644 --- a/src/database.cpp +++ b/src/database.cpp @@ -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 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 diff --git a/src/main.cpp b/src/main.cpp index d7927bf..e9ac5b6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,8 +15,8 @@ int main(int argc, char *argv[]) { configuration.configPath = argv[1]; if (configuration.readConfigFile()) { - std::cout << "ERROR: Unable to read configuration file: " << configuration.configPath << endl; - std::cout << "Aborting Startup!" << endl; + cout << "ERROR: Unable to read configuration file: " << configuration.configPath << endl; + cout << "Aborting Startup!" << endl; return 1; } @@ -264,6 +264,7 @@ int main(int argc, char *argv[]) { CROW_ROUTE(app, "/freelancer/login") ([&,databaseURI](const crow::request& getRequest ) { + /* auto& ctx = app.get_context(getRequest); // Read cookies with get_cookie auto value = ctx.get_cookie("cookieloggedin"); @@ -275,7 +276,7 @@ int main(int argc, char *argv[]) { { ctx.set_cookie("cookieloggedin", "false"); } - return "cookieloggedin: " + value; + return "cookieloggedin: " + value;*/ diff --git a/templates/customerIndex_FreelancerListing.html b/templates/customerIndex_FreelancerListing.html index fd8f1da..a6880e2 100644 --- a/templates/customerIndex_FreelancerListing.html +++ b/templates/customerIndex_FreelancerListing.html @@ -28,6 +28,9 @@
+
+ +
{{/cookieloggedin}} {{#cookieloggedin}}