🐛 fixed return on delete functionality

This commit is contained in:
EntireTwix 2021-06-27 19:33:27 -07:00
parent 3b1a459e18
commit 541b912efe

View file

@ -209,11 +209,7 @@ int_fast8_t Bank::DelUser(const std::string &name, const std::string &attempt) n
{
if constexpr (RETURN_ON_DEL)
{
return (state) ? true : ErrorResponse::WrongPassword;
}
else
{
if (state)
if (state) //if the password matches
{
#if RETURN_ON_DEL
users.modify_if(return_account, [&bal](User &u) {
@ -227,6 +223,10 @@ int_fast8_t Bank::DelUser(const std::string &name, const std::string &attempt) n
return ErrorResponse::WrongPassword;
}
}
else
{
return (state) ? true : ErrorResponse::WrongPassword;
}
}
else
{