Lock user: Improve return code and fix docs (#4377)

* Lock user: Improve return code and fix docs

The docs state that the `DELETE` method should be used, though the controller wants `POST`. The latter seems appropriate here, as the action can be used for locking and unlocking.

Also adapted the action to return a status code based on the actual outcome of the user toggle call.

Closes #4310.

* Update clients
This commit is contained in:
d11n
2022-12-07 19:01:50 +01:00
committed by GitHub
parent 727cf84080
commit f5c5178f95
6 changed files with 21 additions and 16 deletions

View File

@@ -1047,9 +1047,11 @@ namespace BTCPayServer.Controllers.Greenfield
return GetFromActionResult<ApplicationUserData>(await GetController<GreenfieldUsersController>().GetUser(idOrEmail));
}
public override async Task LockUser(string idOrEmail, bool disabled, CancellationToken token = default)
public override async Task<bool> LockUser(string idOrEmail, bool disabled, CancellationToken token = default)
{
HandleActionResult(await GetController<GreenfieldUsersController>().LockUser(idOrEmail, new LockUserRequest() {Locked = disabled}));
return GetFromActionResult<bool>(
await GetController<GreenfieldUsersController>().LockUser(idOrEmail,
new LockUserRequest { Locked = disabled }));
}
public override async Task<OnChainWalletTransactionData> PatchOnChainWalletTransaction(string storeId,