Add user id to Project Members

This commit is contained in:
Julian Vennen 2025-01-15 12:46:10 +01:00 committed by MiniDigger | Martin
parent b6140e4fe3
commit 79c22ae7c2
2 changed files with 3 additions and 3 deletions

View File

@ -132,12 +132,12 @@ public interface ProjectsApiDAO {
@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);

View File

@ -3,5 +3,5 @@ package io.papermc.hangar.model.api.project;
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) {
}