lib/bearcat/client/courses.rb in bearcat-1.3.13 vs lib/bearcat/client/courses.rb in bearcat-1.3.14

- old
+ new

@@ -28,14 +28,19 @@ def course_outcome_results(course, params={}) get("/api/v1/courses/#{course}/outcome_results", params) end - def create_content_migration(course, file_path, params={}) - response = post("/api/v1/courses/#{course}/content_migrations", params) - pre_attachment = response['pre_attachment'] + def create_content_migration_with_both_responses(course, file_path, params={}) + content_migration_response = post("/api/v1/courses/#{course}/content_migrations", params) + pre_attachment = content_migration_response['pre_attachment'] confirmation_url = post_file(pre_attachment['upload_url'], pre_attachment['upload_params'], file_path) - confirm_file_upload(confirmation_url) + [content_migration_response, confirm_file_upload(confirmation_url)] + end + + def create_content_migration(course, file_path, params={}) + content_migration_response, file_upload_response = create_content_migration_with_both_responses(course, file_path, params) + file_upload_response end # Performs effectively the same operation as #create_content_migration, but without the need to specify a file to be uploaded def copy_course(course, params = {}) post("/api/v1/courses/#{course}/content_migrations", params)