made Contains respond 204/404 instead of bool

This commit is contained in:
EntireTwix 2021-07-17 20:46:14 -07:00
parent 62efbd396d
commit 8c660595c9

View file

@ -197,7 +197,16 @@ void api::Close(req_args) const
} }
void api::Contains(req_args, const std::string &name) const void api::Contains(req_args, const std::string &name) const
{ {
RESPONSE_PARSE(BankResponse(k200OK, bank.Contains(name) ? "true" : "false")); BankResponse res;
if (bank.Contains(name))
{
res = BankResponse(k204NoContent, std::nullopt);
}
else
{
res = BankResponse(k404NotFound, "\"User not found\"");
}
RESPONSE_PARSE(std::move(res));
} }
void api::AdminVerifyAccount(req_args) const void api::AdminVerifyAccount(req_args) const
{ {