Skip to content
Snippets Groups Projects
Commit 0569511a authored by OZGCloud's avatar OZGCloud
Browse files

OZG-2626 Verwende uuid weiche beim laden der user profile

parent ecb87b00
Branches
Tags
No related merge requests found
package de.itvsh.kop.user;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import java.util.List;
import java.util.Optional;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import de.itvsh.kop.user.common.errorhandling.FunctionalException;
import de.itvsh.kop.user.common.errorhandling.ResourceNotFoundException;
......@@ -43,8 +44,13 @@ public class UserService {
return repository.findRecipientByOrganisationsEinheitId(organisationsEinheitId);
}
public User findById(String objectId) {
return repository.findById(objectId).orElseThrow(() -> new ResourceNotFoundException(User.class, objectId));
public User findById(String id) {
if (id.contains("-")) {
// TODO wenn user migriert wurden wieder entfernen.
return repository.findByExternalId(id).orElseThrow(() -> new ResourceNotFoundException(User.class, id));
}
return repository.findById(id).orElseThrow(() -> new ResourceNotFoundException(User.class, id));
}
public User findUserByExternalId(String id) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment