feat(api): include accounts in institution dto

This commit is contained in:
Stevan Freeborn
2026-02-24 06:55:37 -06:00
parent 2fa34fe5ab
commit 81c45350e8
4 changed files with 38 additions and 10 deletions
@@ -18,6 +18,7 @@ internal static class Endpoint
var user = await appDbContext.Users
.Include(u => u.Institutions)
.ThenInclude(i => i.Accounts)
.FirstOrDefaultAsync(u => u.Id == userId);
if (user is null)
@@ -26,7 +27,7 @@ internal static class Endpoint
}
var institutionDtos = user.Institutions
.Select(InstitutionDto.FromInstitution)
.Select(InstitutionDto.From)
.OrderBy(dto => dto.Name);
return Results.Ok(Response.From(institutionDtos));