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.
29 lines
923 B
29 lines
923 B
class Admins::CompetitionSettingsController < Admins::BaseController
|
|
def index
|
|
@competition = current_competition
|
|
end
|
|
|
|
def basic_setting
|
|
Admins::CompetitionBasicSettingService.call(current_competition, basic_form_params)
|
|
render_ok
|
|
end
|
|
|
|
def nav_setting
|
|
Admins::CompetitionNavSettingService.call(current_competition, nav_form_params)
|
|
render_ok
|
|
end
|
|
|
|
private
|
|
|
|
def current_competition
|
|
@_current_competition ||= Competition.find(params[:competition_id])
|
|
end
|
|
|
|
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
|
|
|
|
def nav_form_params
|
|
params.permit(:enroll_end_time, competition_staffs: %i[category minimum maximum mutiple_limited], navbar: %i[module_type name hidden position url])
|
|
end
|
|
end |