Use optionally_search for group labels index page

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2018-09-07 17:16:26 +03:00
parent eca3015d88
commit 534f8152c6
No known key found for this signature in database
GPG Key ID: 627C5F589F467F17
2 changed files with 3 additions and 2 deletions

View File

@ -11,8 +11,8 @@ class Groups::LabelsController < Groups::ApplicationController
respond_to do |format|
format.html do
@labels = @group.labels
@labels = @labels.search(params[:search]) if params[:search].present?
@labels = @labels.page(params[:page])
.optionally_search(params[:search])
.page(params[:page])
end
format.json do
render json: LabelSerializer.new.represent_appearance(available_labels)

View File

@ -5,6 +5,7 @@ class Label < ActiveRecord::Base
include Referable
include Subscribable
include Gitlab::SQL::Pattern
include OptionallySearch
# Represents a "No Label" state used for filtering Issues and Merge
# Requests that have no label assigned.