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

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

class Dashboard::LabelsController < Dashboard::ApplicationController
  feature_category :team_planning

  def index
    respond_to do |format|
      format.json { render json: LabelSerializer.new.represent_appearance(labels) }
    end
  end

  def labels
    finder_params = { project_ids: projects.select(:id) }

    LabelsFinder.new(current_user, finder_params).execute
      .select('DISTINCT ON (labels.title) labels.*')
  end
end