Ignore:
Timestamp:
01/12/21 02:42:18 (3 years ago)
Author:
Vzdra <vladko.zdravkovski@…>
Branches:
master
Children:
a70db1a
Parents:
8f1f460
Message:

bugfixes and refactoring

File:
1 edited

Legend:

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

    r8f1f460 r33d4f5d  
    3535    }
    3636
    37     @PostMapping(path = "/user/{id}")
     37    @PostMapping(path = "/user/{id}/{email}")
    3838    public UserResponseDTO editUser(@PathVariable(name = "id") Long id,
     39                                    @PathVariable(name = "email") String email,
    3940                                    @RequestBody UserRegisterDTO body){
    4041
    41         Optional<?> a = this.accountService.findByIdAndEmail(id, body.getEmail(), AccountType.USER);
     42        Optional<?> a = this.accountService.findByIdAndEmail(id, email, AccountType.USER);
    4243
    4344        if(a.isPresent()){
     
    5152    }
    5253
    53     @PostMapping(path = "/company/{id}")
     54    @PostMapping(path = "/company/{id}/{email}")
    5455    public CompanyResponseDTO editCompany(@PathVariable(name = "id") Long id,
     56                                          @PathVariable(name = "email") String email,
    5557                                          @RequestBody CompanyRegisterDTO body){
    5658
    57         Optional<?> a = this.accountService.findByIdAndEmail(id, body.getEmail(), AccountType.COMPANY);
     59        Optional<?> a = this.accountService.findByIdAndEmail(id, email, AccountType.COMPANY);
    5860
    5961        if(a.isPresent()){
     
    6567    }
    6668
    67     @PostMapping(path = "/team/{id}")
     69    @PostMapping(path = "/team/{id}/{email}")
    6870    public TeamResponseDTO editTeam(@PathVariable(name = "id") Long id,
     71                                    @PathVariable(name = "email") String email,
    6972                                    @RequestBody TeamRegisterDTO body){
    7073
    71         Optional<?> a = this.accountService.findByIdAndEmail(id, body.getEmail(), AccountType.TEAM);
     74        Optional<?> a = this.accountService.findByIdAndEmail(id, email, AccountType.TEAM);
    7275
    7376        if(a.isPresent()){
Note: See TracChangeset for help on using the changeset viewer.