class School::FinancialAid::SchoolQuestionsController < ApplicationController
  def index
    render_success :ok, json: questions.by_area(params[:area]).map { |a| props(a) }
  end

  private
    def questions
      current_school.financial_aid_questions
    end

    def props(question)
      {
        id: question.id,
        question: question.question,
        description: question.description,
        answer_type: question.answer_type,
        area: question.area
      }
    end
end
