fix: wrong field search when searching for owner of an instance
This commit is contained in:
parent
f651f417c1
commit
d629357af5
@ -32,12 +32,6 @@ public class UserEndpoints {
|
||||
@Path("/me")
|
||||
@Authenticated
|
||||
public Response getCurrentUser() {
|
||||
System.out.println("=== DEBUG /me endpoint ===");
|
||||
System.out.println("Identity: " + identity);
|
||||
System.out.println("Principal: " + identity.getPrincipal());
|
||||
System.out.println("Principal name: " +
|
||||
identity.getPrincipal().getName());
|
||||
System.out.println("Roles: " + identity.getRoles());
|
||||
LoggedUserResponse user = new LoggedUserResponse(
|
||||
identity.getPrincipal().getName(), identity.getRoles());
|
||||
return Response.ok(user).build();
|
||||
|
@ -29,7 +29,7 @@ public class InstanceService {
|
||||
|
||||
public List<Instance> getAllInstances(String username) {
|
||||
User user = userRepository.findByName(username);
|
||||
return instanceRepository.find("user", user).list();
|
||||
return instanceRepository.find("owner", user).list();
|
||||
}
|
||||
|
||||
public Instance getInstance(Long id) {
|
||||
|
@ -41,7 +41,7 @@ public class UserService {
|
||||
userRepository.deleteById(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Transactional // wtf ? this is get user no ?
|
||||
public User updateUser(Long id) {
|
||||
User user = userRepository.findById(id);
|
||||
return user;
|
||||
|
Loading…
x
Reference in New Issue
Block a user