@byu-oit/canvas-sdk
Advanced tools
Comparing version 0.1.19 to 0.1.20
{ | ||
"name": "@byu-oit/canvas-sdk", | ||
"version": "0.1.19", | ||
"version": "0.1.20", | ||
"description": "A wrapper around Instructure's Canvas API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -64,2 +64,20 @@ 'use strict'; | ||
courses.updName = async function(sisCourseId,name) | ||
{ | ||
const options = { course: { name:name } }; | ||
const res = await canvas.request('PUT', `courses/sis_course_id:${sisCourseId}`, options); | ||
if(res) | ||
{ | ||
logger.info(`Successfully updated course name to ${name} for ${sisCourseId}`); | ||
} | ||
else | ||
{ | ||
logger.error(`Failed to update course name to ${name} for ${sisCourseId}`); | ||
} | ||
}; | ||
courses.delete = async function(sisCourseId) { | ||
@@ -87,2 +105,2 @@ const newId = uuid(); | ||
return courses; | ||
}; | ||
}; |
@@ -142,2 +142,20 @@ 'use strict'; | ||
sections.updName = async function(sisSectionId,name) | ||
{ | ||
const options = { course_section: { name:name } }; | ||
const res = await canvas.request('PUT', `sections/sis_section_id:${sisSectionId}`, options); | ||
if(res) | ||
{ | ||
logger.info(`Successfully updated section name to ${name} for ${sisSectionId}`); | ||
} | ||
else | ||
{ | ||
logger.error(`Failed to update section name to ${name} for ${sisSectionId}`); | ||
} | ||
}; | ||
sections.delete = async function(sisSectionId) { | ||
@@ -174,2 +192,2 @@ // Delete all enrollments prior to deleting section | ||
return sections; | ||
}; | ||
}; |
54488
928