removed assignment id from edit and delete workflow

This commit is contained in:
2023-10-24 14:33:22 -06:00
parent 5280d49523
commit 8342e9cdd3
6 changed files with 55 additions and 17 deletions

View File

@@ -61,16 +61,14 @@
.LocalCourse
.Modules
.First(m =>
m.Assignments
.Select(a => a.Id)
.Contains(assignment.Id)
m.Assignments.Contains(assignment)
) ?? throw new Exception("handling assignment delete, could not find module");
var newModules = planner.LocalCourse.Modules.Select(m =>
m.Name == currentModule.Name
? m with
{
Assignments = m.Assignments.Where(a => a.Id != assignment.Id).ToArray()
Assignments = m.Assignments.Where(a => a != assignment).ToArray()
}
: m
).ToArray();