Sha256: 5f1d8cc4c2a596b11f7bcdcd7f9c4536b2ae3a94637d01b6e51432d7b49ea02c

Contents?: true

Size: 648 Bytes

Versions: 7

Compression:

Stored size: 648 Bytes

Contents

org = @parent_organization || team.organization
@all_apps ||= MnoEnterprise::App.all.to_a

json.id team.id
json.name team.name

json.users do
  json.array! team.users do |user|
    json.extract! user, :id, :name, :surname, :email

    # Retrieve role from cached version (org user list)
    org_user = org.users.to_a.find { |e| e.id == user.id }
    json.role org_user ? org_user.role : nil
  end
end

json.app_instances do
  json.array! team.app_instances do |app_instance|
    json.id app_instance.id
    json.name app_instance.name

    if app = @all_apps.find { |e| e.id == app_instance.app_id }
      json.logo app.logo.to_s
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mno-enterprise-api-3.4.0 app/views/mno_enterprise/jpi/v1/teams/_team.json.jbuilder
mno-enterprise-api-3.3.3 app/views/mno_enterprise/jpi/v1/teams/_team.json.jbuilder
mno-enterprise-api-3.3.2 app/views/mno_enterprise/jpi/v1/teams/_team.json.jbuilder
mno-enterprise-api-3.2.1 app/views/mno_enterprise/jpi/v1/teams/_team.json.jbuilder
mno-enterprise-api-3.3.1 app/views/mno_enterprise/jpi/v1/teams/_team.json.jbuilder
mno-enterprise-api-3.3.0 app/views/mno_enterprise/jpi/v1/teams/_team.json.jbuilder
mno-enterprise-api-3.2.0 app/views/mno_enterprise/jpi/v1/teams/_team.json.jbuilder