Skip to content

Commit

Permalink
Add user id to Project Members
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianVennen authored and MiniDigger committed Jan 17, 2025
1 parent b6140e4 commit 79c22ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 " +
" <offsetLimit>")
List<ProjectMember> getProjectMembers(long id, @BindPagination RequestPagination pagination);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import io.papermc.hangar.model.common.roles.CompactRole;
import java.util.List;

public record ProjectMember(String user, List<CompactRole> roles) {
public record ProjectMember(String user, long userId, List<CompactRole> roles) {
}

0 comments on commit 79c22ae

Please sign in to comment.