public async Task <ActionResult> LearningStandards(LearningStandardsViewModel model) { var learningStandardsModel = new LearningStandardsModel { ApiKey = model.ApiKey, ApiSecret = model.ApiSecret }; var result = await _learningStandardsValidator.ValidateAsync(learningStandardsModel); if (!result.IsValid) { var errorMessages = result.Errors.Select(x => new { x.ErrorMessage }); Response.StatusCode = (int)HttpStatusCode.BadRequest; return(JsonResult(new { Result = new { Errors = errorMessages } })); } await _learningStandardsSetupCommand.Execute( new AcademicBenchmarkConfig { ApiKey = model.ApiKey, ApiSecret = model.ApiSecret, OdsApiMode = CloudOdsAdminAppSettings.Instance.Mode }); await RunLearningStandardsJob(); return(Ok()); }
public async Task <ActionResult> LearningStandards(LearningStandardsModel model) { await _learningStandardsSetupCommand.Execute( new AcademicBenchmarkConfig { ApiKey = model.ApiKey, ApiSecret = model.ApiSecret, OdsApiMode = CloudOdsAdminAppSettings.Instance.Mode }); await RunLearningStandardsJob(); return(Ok()); }