use of com.nexblocks.authguard.api.dto.entities.AccountDTO in project AuthGuard by AuthGuard.
the class AccountsRoute method deleteAccount.
public void deleteAccount(final Context context) {
final String accountId = context.pathParam("id");
final Optional<AccountDTO> account = accountsService.delete(accountId).map(restMapper::toDTO);
if (account.isPresent()) {
context.status(200).json(account.get());
} else {
context.status(404).json(new Error(ErrorCode.ACCOUNT_DOES_NOT_EXIST.getCode(), "Account not found"));
}
}
Aggregations