fix(backend): invert unlisted member filter in RenderUserAsync

This commit is contained in:
sam 2024-09-26 02:14:58 +02:00
parent 6c7a26c73a
commit a4a62fa6b6
Signed by: sam
GPG key ID: B4EF20DDE721CAA1

View file

@ -27,7 +27,7 @@ public class UserRendererService(DatabaseContext db, MemberRendererService membe
IEnumerable<Member> members = IEnumerable<Member> members =
renderMembers ? await db.Members.Where(m => m.UserId == user.Id).ToListAsync(ct) : []; renderMembers ? await db.Members.Where(m => m.UserId == user.Id).ToListAsync(ct) : [];
// Unless the user is requesting their own members AND the token can read hidden members, we filter out unlisted members. // Unless the user is requesting their own members AND the token can read hidden members, we filter out unlisted members.
if (!(isSelfUser && tokenCanReadHiddenMembers)) members = members.Where(m => m.Unlisted); if (!(isSelfUser && tokenCanReadHiddenMembers)) members = members.Where(m => !m.Unlisted);
var authMethods = renderAuthMethods var authMethods = renderAuthMethods
? await db.AuthMethods ? await db.AuthMethods