Ignore:
Timestamp:
01/08/21 21:27:43 (4 years ago)
Author:
Vzdra <vladko.zdravkovski@…>
Branches:
master
Children:
bd46dbb
Parents:
14b648e
Message:

bugfix

Location:
src/main/java/it/finki/tinki/web/controller
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • src/main/java/it/finki/tinki/web/controller/AccountEditController.java

    r14b648e rbd38a55  
    1919
    2020@RestController
    21 @RequestMapping(path = "/api/edit")
    22 public class EditController {
     21@RequestMapping(path = "/api/edit/account")
     22public class AccountEditController {
    2323
    2424    AccountService accountService;
    2525    SkillService skillService;
    2626
    27     public EditController(AccountService accountService, SkillService skillService) {
     27    public AccountEditController(AccountService accountService, SkillService skillService) {
    2828        this.accountService = accountService;
    2929        this.skillService = skillService;
     
    4141            List<Skill> toLearn = this.skillService.returnSkillsBasedOnId(body.getSkillsToLearn());
    4242
    43             User u = (User) this.accountService.editUser(id, body.getEmail(), body.getName(), body.getSurname(), retained, toLearn);
     43            User u = this.accountService.editUser(id, body.getEmail(), body.getName(), body.getSurname(), retained, toLearn);
    4444
    4545            UserResponseDTO userResponseDTO = new UserResponseDTO();
    4646
     47            userResponseDTO.setId(u.getId());
    4748            userResponseDTO.setEmail(u.getEmail());
     49            userResponseDTO.setType(AccountType.USER);
    4850            userResponseDTO.setName(u.getName());
    4951            userResponseDTO.setSurname(u.getSurname());
     
    6971            CompanyResponseDTO companyResponseDTO = new CompanyResponseDTO();
    7072
     73            companyResponseDTO.setId(c.getId());
    7174            companyResponseDTO.setEmail(c.getEmail());
     75            companyResponseDTO.setType(AccountType.COMPANY);
    7276            companyResponseDTO.setName(c.getName());
    7377            companyResponseDTO.setAddress(c.getAddress());
     
    9195            TeamResponseDTO teamResponseDTO = new TeamResponseDTO();
    9296
     97            teamResponseDTO.setId(t.getId());
    9398            teamResponseDTO.setEmail(t.getEmail());
     99            teamResponseDTO.setType(AccountType.TEAM);
    94100            teamResponseDTO.setName(t.getName());
    95101            teamResponseDTO.setMembers(t.getMembers());
Note: See TracChangeset for help on using the changeset viewer.