mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
can add pages
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using LocalModels;
|
||||
using Management.Services.Canvas;
|
||||
|
||||
public static class PageSynchronizationExtension
|
||||
{
|
||||
public static async Task<ulong?> AddPageToCanvas(
|
||||
this LocalCourse localCourse,
|
||||
LocalCoursePage localPage,
|
||||
CanvasService canvas
|
||||
)
|
||||
{
|
||||
if (localCourse.Settings.CanvasId == null)
|
||||
{
|
||||
Console.WriteLine("Cannot add page to canvas without canvas course id");
|
||||
return null;
|
||||
}
|
||||
ulong courseCanvasId = (ulong)localCourse.Settings.CanvasId;
|
||||
|
||||
var canvasPageId = await canvas.Pages.Create(courseCanvasId, localPage);
|
||||
return canvasPageId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user