mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-17 00:22:14 +11:00
🎨 changed SetBal format to match that of ImpactBal()
This commit is contained in:
parent
a78afc314e
commit
e04dcc926d
1 changed files with 5 additions and 5 deletions
10
src/bank.cpp
10
src/bank.cpp
|
|
@ -156,11 +156,7 @@ void Bank::ChangePassword(const std::string &name, const std::string &new_pass)
|
|||
}
|
||||
BankResponse Bank::SetBal(const std::string &name, uint32_t amount) noexcept
|
||||
{
|
||||
if (!ValidUsername(name) || !users.modify_if(name, [amount](User &u) { u.balance = amount; }))
|
||||
{
|
||||
return {k404NotFound, "\"User not found\""};
|
||||
}
|
||||
else
|
||||
if (ValidUsername(name) && users.modify_if(name, [amount](User &u) { u.balance = amount; }))
|
||||
{
|
||||
#if CONSERVATIVE_DISK_SAVE
|
||||
#if MULTI_THREADED
|
||||
|
|
@ -171,6 +167,10 @@ BankResponse Bank::SetBal(const std::string &name, uint32_t amount) noexcept
|
|||
#endif
|
||||
return {k204NoContent, std::nullopt}; //returns new balance
|
||||
}
|
||||
else
|
||||
{
|
||||
return {k404NotFound, "\"User not found\""};
|
||||
}
|
||||
}
|
||||
BankResponse Bank::ImpactBal(const std::string &name, int64_t amount) noexcept
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue