fix: UserService hardening
This commit is contained in:
parent
a78ecaeadb
commit
2f7e706548
1 changed files with 2 additions and 1 deletions
|
@ -7,6 +7,7 @@ import eu.ztsh.wymiana.util.UserMapper;
|
|||
import eu.ztsh.wymiana.validation.InstanceValidator;
|
||||
import eu.ztsh.wymiana.web.model.UserCreateRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.hibernate.validator.constraints.pl.PESEL;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Optional;
|
||||
|
@ -26,7 +27,7 @@ public class UserService {
|
|||
return UserMapper.entityToPojo(userRepository.save(UserMapper.requestToEntity(request)));
|
||||
}
|
||||
|
||||
public Optional<User> get(String pesel) {
|
||||
public Optional<User> get(@PESEL String pesel) {
|
||||
return userRepository.findById(pesel).map(UserMapper::entityToPojo);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue