diff --git a/app/controllers/outcomes_import_api_controller.rb b/app/controllers/outcomes_import_api_controller.rb index c806b99fbe2..d7193968de1 100644 --- a/app/controllers/outcomes_import_api_controller.rb +++ b/app/controllers/outcomes_import_api_controller.rb @@ -18,6 +18,7 @@ class OutcomesImportApiController < ApplicationController include Api::V1::Outcome + include Api::V1::ContentMigration before_filter :require_user, :can_manage_global_outcomes, :has_api_config @@ -48,6 +49,17 @@ class OutcomesImportApiController < ApplicationController end end + def migration_status + return render json: { error: "must specify a migration id" } unless params[:migration_id] + + begin + cm = ContentMigration.find(params[:migration_id]) + render json: content_migration_json(cm, @current_user, session) + rescue ActiveRecord::RecordNotFound => e + render json: { error: "no content migration matching id #{params[:migration_id]}" } + end + end + protected def can_manage_global_outcomes diff --git a/config/routes.rb b/config/routes.rb index 1873eb5d938..fc6e31d7d3e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1572,6 +1572,7 @@ CanvasRails::Application.routes.draw do # get "global/outcomes_import/list/:guid", action: :list get "global/outcomes_import/available", action: :available post "global/outcomes_import", action: :create + get "global/outcomes_import/migration_status/:migration_id", action: :migration_status end scope(controller: :group_categories) do