mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
module item sorting fixed
This commit is contained in:
@@ -24,8 +24,8 @@ public class CanvasAssignmentService(
|
||||
assignments =>
|
||||
assignments.Select(
|
||||
a => a with { DueAt = a.DueAt?.ToLocalTime(), LockAt = a.LockAt?.ToLocalTime() }
|
||||
)
|
||||
);
|
||||
).ToArray()
|
||||
).ToArray();
|
||||
}
|
||||
|
||||
public async Task<ulong> Create(
|
||||
|
||||
@@ -62,7 +62,16 @@ public class CanvasModuleService
|
||||
var (items, response) = await webRequestor.GetAsync<IEnumerable<CanvasModuleItem>>(request);
|
||||
if (items == null)
|
||||
throw new Exception($"Error getting canvas module items for {url}");
|
||||
return items;
|
||||
return items.Select(i =>
|
||||
i with {
|
||||
ContentDetails = i.ContentDetails == null
|
||||
? null
|
||||
: i.ContentDetails with {
|
||||
DueAt = i.ContentDetails.DueAt?.ToLocalTime(),
|
||||
LockAt = i.ContentDetails.LockAt?.ToLocalTime(),
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public async Task<Dictionary<CanvasModule, IEnumerable<CanvasModuleItem>>> GetAllModulesItems(
|
||||
@@ -90,4 +99,4 @@ public class CanvasModuleService
|
||||
}
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public class CanvasService(
|
||||
CanvasQuizService Quizzes,
|
||||
CanvasCoursePageService Pages,
|
||||
MyLogger<CanvasService> logger
|
||||
)
|
||||
)
|
||||
{
|
||||
private readonly IWebRequestor webRequestor = webRequestor;
|
||||
private readonly CanvasServiceUtils utils = utils;
|
||||
|
||||
Reference in New Issue
Block a user