server: Initial new vpnuser state (#8268)

This commit is contained in:
dahn 2023-12-01 09:51:54 +01:00 committed by GitHub
parent 7d6dc41f99
commit 724394682c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -125,6 +125,9 @@ public class AddVpnUserCmd extends BaseAsyncCreateCmd {
vpnResponse.setId(vpnUser.getUuid());
vpnResponse.setUserName(vpnUser.getUsername());
vpnResponse.setAccountName(account.getAccountName());
// re-retrieve the vpnuser, as the call to `applyVpnUsers` might have changed the state
vpnUser = _entityMgr.findById(VpnUser.class, getEntityId());
vpnResponse.setState(vpnUser.getState().toString());
Domain domain = _entityMgr.findById(Domain.class, account.getDomainId());
if (domain != null) {

View File

@ -57,7 +57,7 @@ public class VpnUsersResponse extends BaseResponse implements ControlledEntityRe
private String projectName;
@SerializedName(ApiConstants.STATE)
@Param(description = "the state of the Vpn User")
@Param(description = "the state of the Vpn User, can be 'Add', 'Revoke' or 'Active'.")
private String state;
public void setId(String id) {