SUPPORT-8999: refactor code
This commit is contained in:
parent
dde833212f
commit
99da820694
4 changed files with 4 additions and 10 deletions
|
|
@ -85,7 +85,7 @@ public class AdminController {
|
|||
|
||||
@PostMapping(value = "/account", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<?> editAccount(@RequestBody @Valid EditAccountDto dto) {
|
||||
Account account = new Account(dto.id(), dto.userDomain(), dto.position());
|
||||
Account account = new Account(dto.userDomain(), dto.position());
|
||||
EditPersonProcessRequest request = new EditPersonProcessRequest(ProcessKey.EDIT_ACCOUNT.getValue(),
|
||||
getUserId(), new EditData(account));
|
||||
return doRequest(request);
|
||||
|
|
|
|||
|
|
@ -29,12 +29,6 @@ public class Account {
|
|||
this.position = position;
|
||||
}
|
||||
|
||||
public Account(String id, String userDomain, String position) {
|
||||
this.id = id;
|
||||
this.userDomain = userDomain;
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public Account(String accountId, List<String> removeRoles, List<Role> rolesList) {
|
||||
this.accountId = accountId;
|
||||
this.removeRoles = removeRoles;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,5 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|||
* @author Emir Suleimanov
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public record EditAccountDto(String username, @NotNull String position, String id,
|
||||
@NotNull @NotEmpty String userDomain) {
|
||||
public record EditAccountDto(@NotNull String position, @NotNull @NotEmpty String userDomain) {
|
||||
}
|
||||
|
|
@ -62,8 +62,9 @@ export class UserManagementService extends Behavior {
|
|||
|
||||
private doRequest(url: string, jsonObj: any): void {
|
||||
this.httpClient.post(url, jsonObj).toPromise()
|
||||
.catch(() => {
|
||||
.catch(reason => {
|
||||
//TODO change status
|
||||
console.error("Error while executing request:", reason.toString());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue