Changeset bd38a55 for src/main/java/it


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
Files:
1 added
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • src/main/java/it/finki/tinki/model/dto/CompanyResponseDTO.java

    r14b648e rbd38a55  
    22
    33import it.finki.tinki.model.Address;
    4 import it.finki.tinki.model.Jobs.Internship;
    5 import it.finki.tinki.model.Jobs.Job;
    64import lombok.Data;
    75
     6import java.util.ArrayList;
    87import java.util.List;
    98
     
    1312    private List<JobResponseDTO> jobs;
    1413    private List<InternshipResponseDTO> internships;
     14
     15    public CompanyResponseDTO(){
     16        this.jobs = new ArrayList<>();
     17        this.internships = new ArrayList<>();
     18    }
    1519}
  • src/main/java/it/finki/tinki/model/dto/TeamResponseDTO.java

    r14b648e rbd38a55  
    33import lombok.Data;
    44
     5import java.util.ArrayList;
    56import java.util.List;
    67
     
    1011    private List<JobResponseDTO> jobs;
    1112    private List<ProjectResponseDTO> projects;
     13
     14    public TeamResponseDTO(){
     15        this.jobs = new ArrayList<>();
     16        this.projects = new ArrayList<>();
     17    }
    1218}
  • 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.