From 239573e2464ac8afc28dfa86f05cdf0d712c27d2 Mon Sep 17 00:00:00 2001 From: EntireTwix Date: Fri, 28 May 2021 02:25:48 -0700 Subject: [PATCH] :racehorse: improved getlogs endpoint when max log size is 0 --- include/bank.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/bank.hpp b/include/bank.hpp index 0809258..3df66da 100644 --- a/include/bank.hpp +++ b/include/bank.hpp @@ -171,9 +171,9 @@ public: Json::Value GetLogs(const std::string &name, const std::string &attempt) { - Json::Value res; if constexpr (max_log_size) { + Json::Value res; if (!users.if_contains(name, [&res, &attempt](const User &u) { if (u.password != XXH3_64bits(attempt.data(), attempt.size())) { @@ -187,8 +187,12 @@ public: { return -1; } - } return res; + } + else + { + return "logs are disabled"; + } } void Save()