class MobileAppApi::V1::ComapniesController < ApplicationController

  # Api to update pusher configuration of company.
  def index
    company_details = []
    @companies = Company.includes(:pusher_configuration)
    if @companies.exists?
      @companies.each do |company|
        company_details << company.attributes.except('created_at','updated_at').merge(pusher_app_key: company.pusher_configuration.try(:api_key))
      end
      render json: {status: 200, company_info: company_details}
    else
      render json: {status: 401, error: "Company is not present"}
    end
  end

end
