minor changes
This commit is contained in:
@ -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
|
||||
|
@ -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<crow::CookieParser>(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;*/
|
||||
|
||||
|
||||
|
||||
|
@ -28,6 +28,9 @@
|
||||
<form action="/freelancer/login" method="get">
|
||||
<button type="submit" class="button">Freelancer Login</button>
|
||||
</form>
|
||||
<form action="/freelancer/signup" method="get">
|
||||
<button type="submit" class="button">Freelancer Sign-Up</button>
|
||||
</form>
|
||||
{{/cookieloggedin}}
|
||||
{{#cookieloggedin}}
|
||||
<form action="/freelancer/profile" method="get">
|
||||
|
Reference in New Issue
Block a user