mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
removed assignment id from drag and drop
This commit is contained in:
@@ -15,9 +15,7 @@ public class DroppableAssignment : ComponentBase
|
||||
.LocalCourse
|
||||
.Modules
|
||||
.First(m =>
|
||||
m.Assignments
|
||||
.Select(a => a.Id)
|
||||
.Contains(Assignment.Id)
|
||||
m.Assignments.Contains(Assignment)
|
||||
) ?? throw new Exception("in day callback, could not find module");
|
||||
|
||||
|
||||
@@ -33,7 +31,7 @@ public class DroppableAssignment : ComponentBase
|
||||
var moduleWithUpdatedAssignment = currentModule with
|
||||
{
|
||||
Assignments = currentModule.Assignments.Select(a =>
|
||||
a.Id != Assignment.Id
|
||||
a.Name != Assignment.Name // we are only changing the due date, so the name should be the same
|
||||
? a
|
||||
: a with
|
||||
{
|
||||
@@ -60,11 +58,11 @@ public class DroppableAssignment : ComponentBase
|
||||
m.Name != module.Name
|
||||
? m with
|
||||
{
|
||||
Assignments = m.Assignments.Where(a => a.Id != Assignment.Id).DistinctBy(a => a.Id)
|
||||
Assignments = m.Assignments.Where(a => a.Name != Assignment.Name).DistinctBy(a => a.Name)
|
||||
}
|
||||
: m with
|
||||
{
|
||||
Assignments = m.Assignments.Append(Assignment).DistinctBy(a => a.Id)
|
||||
Assignments = m.Assignments.Append(Assignment).DistinctBy(a => a.Name)
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
System.Console.WriteLine("new assignment");
|
||||
var newAssignment = new LocalAssignment
|
||||
{
|
||||
Id = Guid.NewGuid().ToString(),
|
||||
Name = Name,
|
||||
Description = "",
|
||||
LockAtDueDate = true,
|
||||
|
||||
Reference in New Issue
Block a user