Skip to content

Commit ab33aa1

Browse files
committed
Fix problem with deleted groups and character api
1 parent 4ad59b1 commit ab33aa1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/JoinRpg.Dal.Impl/Repositories/CharacterRepositoryImpl.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public async Task<CharacterView> GetCharacterViewAsync(int projectId, int charac
6868
.SingleOrDefaultAsync();
6969

7070
var allGroups = await Ctx.Set<CharacterGroup>().AsNoTracking()
71-
.Where(cg => cg.ProjectId == projectId && cg.IsActive)
71+
.Where(cg => cg.ProjectId == projectId) // need to load inactive groups here
7272
.Select(groupHeaderSelector)
7373
.ToDictionaryAsync(d => d.CharacterGroupId);
7474

@@ -107,6 +107,7 @@ public async Task<CharacterView> GetCharacterViewAsync(int projectId, int charac
107107

108108
view.AllGroups = view.DirectGroups
109109
.SelectMany(g => g.FlatTree(group => group.ParentGroupIds._parentCharacterGroupIds.Select(id => allGroups[id])))
110+
.Where(g => g.IsActive)
110111
.Distinct()
111112
.ToList();
112113
return view;

0 commit comments

Comments
 (0)