mirror of
https://github.com/Expand-sys/CCash
synced 2026-03-22 20:47:10 +11:00
🐛 "doc["time"].get(pass)" -> "doc["pass"].get(pass)"
This commit is contained in:
parent
2c62c89b47
commit
54acbf8cc6
1 changed files with 3 additions and 5 deletions
|
|
@ -1,7 +1,5 @@
|
|||
#include "bank_api.h"
|
||||
|
||||
// TODO: parser iterate(input).get(doc) error handling might be superfulous
|
||||
|
||||
#define CACHE_FOREVER resp->setExpiredTime(0)
|
||||
|
||||
#define CORS resp->addHeader("Access-Control-Allow-Origin", "*")
|
||||
|
|
@ -96,7 +94,7 @@ void api::ChangePassword(req_args)
|
|||
else
|
||||
{
|
||||
std::string_view pass;
|
||||
if (doc["time"].get(pass))
|
||||
if (doc["pass"].get(pass))
|
||||
{
|
||||
res = BankResponse{k400BadRequest, "\"Missing/Invalid JSON arg(s)\""};
|
||||
}
|
||||
|
|
@ -120,7 +118,7 @@ void api::AdminChangePassword(req_args)
|
|||
else
|
||||
{
|
||||
std::string_view name, pass;
|
||||
if (doc["name"].get(name) || doc["time"].get(pass))
|
||||
if (doc["name"].get(name) || doc["pass"].get(pass))
|
||||
{
|
||||
res = BankResponse{k400BadRequest, "\"Missing/Invalid JSON arg(s)\""};
|
||||
}
|
||||
|
|
@ -319,7 +317,7 @@ void api::AdminAddUser(req_args)
|
|||
std::string_view name;
|
||||
uint64_t amount;
|
||||
std::string_view pass;
|
||||
if (doc["name"].get(name) || doc["amount"].get(amount) || doc["time"].get(pass) || (amount > std::numeric_limits<uint32_t>::max()))
|
||||
if (doc["name"].get(name) || doc["amount"].get(amount) || doc["pass"].get(pass) || (amount > std::numeric_limits<uint32_t>::max()))
|
||||
{
|
||||
res = BankResponse{k400BadRequest, "\"Missing/Invalid JSON arg(s)\""};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue