Welcome to mirror list, hosted at ThFree Co, Russian Federation.

app_data_serializer.rb « jira_connect « serializers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5e275f35beba7e1faf3a691d9577ae87b4c6acb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

class JiraConnect::AppDataSerializer
  include Gitlab::Routing
  include ::API::Helpers::RelatedResourcesHelpers

  def initialize(subscriptions)
    @subscriptions = subscriptions
  end

  def as_json
    skip_groups = @subscriptions.map(&:namespace_id)

    {
      groups_path: api_v4_groups_path(params: { min_access_level: Gitlab::Access::MAINTAINER, skip_groups: skip_groups }),
      subscriptions: JiraConnect::SubscriptionEntity.represent(@subscriptions).as_json,
      subscriptions_path: jira_connect_subscriptions_path
    }
  end
end