Commit dfcc1201 authored by Eric Dieckman's avatar Eric Dieckman
Browse files

feat: include members and contact types in WiscNic group GETs

Eager-load Members with their Person and ContactType so list/detail responses
return the full group composition without requiring a follow-up call to
/members.
parent 7da9d94b
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@ public class WiscNicGroupsController : ControllerBase
    {
        List<WiscNicGroup> result = await _context.WiscNicGroups
            .Where(e => e.IsActive == true)
            .Include(g => g.Members).ThenInclude(m => m.Member)
            .Include(g => g.Members).ThenInclude(m => m.ContactType)
            .ToListAsync();

        return Ok(result);
@@ -34,6 +36,8 @@ public class WiscNicGroupsController : ControllerBase
    {
        WiscNicGroup? result = await _context.WiscNicGroups
            .Where(e => e.WiscNicGroupId == groupId)
            .Include(g => g.Members).ThenInclude(m => m.Member)
            .Include(g => g.Members).ThenInclude(m => m.ContactType)
            .FirstOrDefaultAsync();

        if (result == null)