Ignore:
Timestamp:
01/06/21 18:21:03 (4 years ago)
Author:
i-ina <76742075+i-ina@…>
Branches:
master
Children:
721cb87
Parents:
7edede9
Message:

added team register

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/it/finki/tinki/service/impl/AccountServiceImpl.java

    r7edede9 r504c3ef  
    6767        return this.userRepository.save(u);
    6868    }
     69
     70    public Account registerTeam(String email, String password, String name, int members){
     71        if(email==null || email.isEmpty() || password==null || password.isEmpty() || name==null || name.isEmpty()){
     72            throw new InvalidArgumentsException();
     73        }
     74
     75        if(this.teamRepository.findByEmail(email).isPresent()){
     76            throw new UserExistsException();
     77        }
     78
     79        Team t = new Team(email, password, name, AccountType.TEAM, members);
     80        return this.teamRepository.save(t);
     81    }
    6982}
Note: See TracChangeset for help on using the changeset viewer.