public async Task <IActionResult> VolunteerTrainingEdit(VolunteerTrainingModel training)
        {
            VolunteerRepository    repo = new VolunteerRepository(configModel.ConnectionString);
            VolunteerTrainingModel dbTraining;
            var user = await userManager.GetUserAsync(User);

            // Verify the user is a staff member
            if (!User.IsInRole(UserHelpers.UserRoles.Staff.ToString()))
            {
                return(Utilities.ErrorJson("Not authorized"));
            }

            // Validate inputs
            dbTraining = repo.GetTraining(training.Id);
            if (dbTraining == null)
            {
                return(Utilities.ErrorJson("Invalid id"));
            }

            // If there has been no change, we can just return
            if (dbTraining.Name == training.Name)
            {
                return(Utilities.NoErrorJson());
            }

            if (String.IsNullOrEmpty(training.Name))
            {
                return(Utilities.ErrorJson("Name is required"));
            }

            try
            {
                repo.EditTraining(training.Id, training.Name);
            }
            catch (Exception e)
            {
                return(Utilities.ErrorJson(e.Message));
            }

            return(Utilities.NoErrorJson());
        }