fix: wrong field search when searching for owner of an instance

This commit is contained in:
Arthur Wambst 2025-08-22 00:23:47 +02:00
parent f651f417c1
commit d629357af5
No known key found for this signature in database
3 changed files with 2 additions and 8 deletions

View File

@ -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();

View File

@ -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) {

View File

@ -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;