You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/controllers/admins/competition_settings_contro...

29 lines
923 B

class Admins::CompetitionSettingsController < Admins::BaseController
5 years ago
def index
@competition = current_competition
end
5 years ago
def basic_setting
5 years ago
Admins::CompetitionBasicSettingService.call(current_competition, basic_form_params)
render_ok
end
def nav_setting
5 years ago
Admins::CompetitionNavSettingService.call(current_competition, nav_form_params)
render_ok
end
private
def current_competition
@_current_competition ||= Competition.find(params[:competition_id])
end
5 years ago
def basic_form_params
params.permit(:identifier, :name, :sub_title, :sponsor_schools, :region_schools, :start_time, :end_time, :mode, :identifier, :bonus, :awards_count, :description, :course_id, :teach_start_time, :teach_end_time)
end
5 years ago
def nav_form_params
5 years ago
params.permit(:enroll_end_time, competition_staffs: %i[category minimum maximum mutiple_limited], navbar: %i[module_type name hidden position url])
5 years ago
end
end