From 56bae9cf8a8308acce93850d2d3a9343a033b874 Mon Sep 17 00:00:00 2001 From: EntireTwix Date: Wed, 7 Apr 2021 00:49:01 -0700 Subject: [PATCH] :bug: finally fixed Json type issues --- include/bank_f.hpp | 4 ++++ include/user.hpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/bank_f.hpp b/include/bank_f.hpp index f12c689..8127cc7 100644 --- a/include/bank_f.hpp +++ b/include/bank_f.hpp @@ -19,6 +19,10 @@ INLINE Json::Value JsonReturn(T &&val) { res["value"] = (int)val; //becuase of json lib interpreting 67 as 'A' for example } + else if constexpr (std::is_same_v) + { + res["value"] = (Json::UInt64)val; + } else { res["value"] = val; diff --git a/include/user.hpp b/include/user.hpp index 186ba51..df833af 100644 --- a/include/user.hpp +++ b/include/user.hpp @@ -25,7 +25,7 @@ struct User Json::Value Serialize() const { Json::Value res; - res["balance"] = balance; + res["balance"] = (Json::UInt)balance; res["password"] = password; return res; }