2021-10-27 15:23:28 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class JiraConnect::AppDataSerializer
|
|
|
|
include Gitlab::Routing
|
|
|
|
include ::API::Helpers::RelatedResourcesHelpers
|
|
|
|
|
2023-07-09 08:55:56 +05:30
|
|
|
def initialize(subscriptions)
|
2021-10-27 15:23:28 +05:30
|
|
|
@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,
|
2023-07-09 08:55:56 +05:30
|
|
|
subscriptions_path: jira_connect_subscriptions_path
|
2021-10-27 15:23:28 +05:30
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|