mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-17 00:22:14 +11:00
🐛 admin changepass should be able to respond with 404
This commit is contained in:
parent
822a0d2647
commit
162b421c8b
2 changed files with 11 additions and 4 deletions
|
|
@ -51,7 +51,7 @@
|
|||
| name | 400 | 401 | 404 | 406 |
|
||||
| :------------------ | :----------------: | :----------------: | :----------------------: | :----------------: |
|
||||
| ChangePassword | :heavy_check_mark: | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_check_mark: |
|
||||
| AdminChangePassword | :heavy_check_mark: | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_check_mark: |
|
||||
| AdminChangePassword | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
||||
| SetBal | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
||||
|
||||
### Meta endpoint support
|
||||
|
|
|
|||
|
|
@ -119,10 +119,17 @@ void api::AdminChangePassword(req_args) const
|
|||
else
|
||||
{
|
||||
StrFromSV_Wrapper name_val(name.value());
|
||||
if (bank.Contains(name_val.str))
|
||||
{
|
||||
StrFromSV_Wrapper pass_val(pass.value());
|
||||
bank.ChangePassword(name_val.str, pass_val.str);
|
||||
res = BankResponse{k204NoContent, std::nullopt};
|
||||
}
|
||||
else
|
||||
{
|
||||
res = BankResponse{k404NotFound, "\"User not found\""};
|
||||
}
|
||||
}
|
||||
}
|
||||
RESPONSE_PARSE(std::move(res));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue