class School::Admissions::ConfigsController < ApplicationController
  skip_before_action :authenticate_request!
  skip_before_action :enforce_password_reset!
  skip_before_action :enforce_terms_of_service_agreement!

  def show
    render_success :ok, json: config_props(config)
  end

  private
    def config
      @config ||= Admission::Config.find_or_initialize_by(school: school)
    end

    def school
      @school ||= School.find_by(id: params[:id])
    end

    def config_props(config)
      {
        welcome_message: config.welcome_message,
        registration: config.registration
      }
    end
end
