mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
removed assignment id from drag and drop
This commit is contained in:
@@ -15,9 +15,7 @@ public class DroppableAssignment : ComponentBase
|
|||||||
.LocalCourse
|
.LocalCourse
|
||||||
.Modules
|
.Modules
|
||||||
.First(m =>
|
.First(m =>
|
||||||
m.Assignments
|
m.Assignments.Contains(Assignment)
|
||||||
.Select(a => a.Id)
|
|
||||||
.Contains(Assignment.Id)
|
|
||||||
) ?? throw new Exception("in day callback, could not find module");
|
) ?? throw new Exception("in day callback, could not find module");
|
||||||
|
|
||||||
|
|
||||||
@@ -33,7 +31,7 @@ public class DroppableAssignment : ComponentBase
|
|||||||
var moduleWithUpdatedAssignment = currentModule with
|
var moduleWithUpdatedAssignment = currentModule with
|
||||||
{
|
{
|
||||||
Assignments = currentModule.Assignments.Select(a =>
|
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
|
||||||
: a with
|
: a with
|
||||||
{
|
{
|
||||||
@@ -60,11 +58,11 @@ public class DroppableAssignment : ComponentBase
|
|||||||
m.Name != module.Name
|
m.Name != module.Name
|
||||||
? m with
|
? 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
|
: 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");
|
System.Console.WriteLine("new assignment");
|
||||||
var newAssignment = new LocalAssignment
|
var newAssignment = new LocalAssignment
|
||||||
{
|
{
|
||||||
Id = Guid.NewGuid().ToString(),
|
|
||||||
Name = Name,
|
Name = Name,
|
||||||
Description = "",
|
Description = "",
|
||||||
LockAtDueDate = true,
|
LockAtDueDate = true,
|
||||||
|
|||||||
Reference in New Issue
Block a user