class ApiSignupHintsController < ApiController

  before_filter :api_anonymous_user, except: [:create_redirect]
  before_filter :api_signed_in_user, only: [:create_redirect]

  respond_to :json

  def show
    @signup_hint = SignupHint.find(params[:id])
    respond_with_model(@signup_hint)
  end

  def create
    @signup_hint = SignupHint.refresh_by_anoymous_user(anonymous_user, params)

    respond_with_model(@signup_hint, new: true, location: lambda { return api_signup_hint_detail_url(@signup_hint.id) })
  end

  def create_redirect
    @signup_hint = SignupHint.create_redirect(current_user, params)

    respond_with_model(@signup_hint, new: true, location: lambda { return api_signup_hint_detail_url(@signup_hint.id) })
  end
end


