Sha256: d1f8d4ab055b7c776c936dd311357ba5d3b49ab2567a88865a30981331e8f9d3

Contents?: true

Size: 678 Bytes

Versions: 5

Compression:

Stored size: 678 Bytes

Contents

module MnoEnterprise
  class Jpi::V1::MarketplaceController < ApplicationController
    respond_to :json

    # GET /mnoe/mnoe/jpi/v1/marketplace
    def index
      @apps = if MnoEnterprise.marketplace_listing
        MnoEnterprise::App.where('nid.in' => MnoEnterprise.marketplace_listing).to_a
      else
        MnoEnterprise::App.all.to_a
      end
      @apps.sort_by! { |app| [app.rank ? 0 : 1 , app.rank] } # the nil ranks will appear at the end
      @categories = MnoEnterprise::App.categories(@apps)
      @categories.delete('Most Popular')
    end

    # GET /mnoe/jpi/v1/marketplace/1
    def show
      @app = MnoEnterprise::App.find(params[:id])
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mno-enterprise-api-3.1.4 app/controllers/mno_enterprise/jpi/v1/marketplace_controller.rb
mno-enterprise-api-3.1.3 app/controllers/mno_enterprise/jpi/v1/marketplace_controller.rb
mno-enterprise-api-3.1.2 app/controllers/mno_enterprise/jpi/v1/marketplace_controller.rb
mno-enterprise-api-3.1.1 app/controllers/mno_enterprise/jpi/v1/marketplace_controller.rb
mno-enterprise-api-3.1.0 app/controllers/mno_enterprise/jpi/v1/marketplace_controller.rb