class Admins::CompetitionSettingsController < Admins::BaseController
  def show
    @competition = current_competition
  end

  def update
    Admins::SaveLaboratorySettingService.call(current_competition, form_params)
    render_ok
  end

  private

  def current_competition
    @_current_competition ||= Competition.find(params[:competition_id])
  end

  def form_params
    params.permit(:identifier, :name, :nav_logo, :login_logo, :tab_logo, :footer, navbar: %i[name link hidden])
  end
end