diff --git a/backend/src/main/java/io/papermc/hangar/db/dao/v1/ProjectsApiDAO.java b/backend/src/main/java/io/papermc/hangar/db/dao/v1/ProjectsApiDAO.java index acf48431b..6030a3f78 100644 --- a/backend/src/main/java/io/papermc/hangar/db/dao/v1/ProjectsApiDAO.java +++ b/backend/src/main/java/io/papermc/hangar/db/dao/v1/ProjectsApiDAO.java @@ -132,12 +132,12 @@ SELECT count(hp.id) @RegisterConstructorMapper(ProjectMember.class) @RegisterColumnMapperFactory(CompactRoleColumnMapperFactory.class) - @SqlQuery("SELECT u.name AS \"user\", array_agg(r.name) roles " + + @SqlQuery("SELECT u.name AS \"user\", u.id AS \"userId\", array_agg(r.name) roles " + " FROM user_project_roles upr" + " JOIN users u ON upr.user_id = u.id " + " JOIN roles r ON upr.role_type = r.name " + " WHERE upr.project_id = :id " + - " GROUP BY u.name ORDER BY max(r.permission::bigint) DESC " + + " GROUP BY u.name, u.id ORDER BY max(r.permission::bigint) DESC " + " ") List getProjectMembers(long id, @BindPagination RequestPagination pagination); diff --git a/backend/src/main/java/io/papermc/hangar/model/api/project/ProjectMember.java b/backend/src/main/java/io/papermc/hangar/model/api/project/ProjectMember.java index bf95a4615..850285177 100644 --- a/backend/src/main/java/io/papermc/hangar/model/api/project/ProjectMember.java +++ b/backend/src/main/java/io/papermc/hangar/model/api/project/ProjectMember.java @@ -3,5 +3,5 @@ import io.papermc.hangar.model.common.roles.CompactRole; import java.util.List; -public record ProjectMember(String user, List roles) { +public record ProjectMember(String user, long userId, List roles) { }