From ad7148d9ead6e76a80840c069ca0921f7e790041 Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Wed, 4 Apr 2018 15:40:29 +0000 Subject: Allow assigning and filtering issuables by ancestor group labels --- lib/api/helpers.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/api/helpers.rb') diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index e59e8a45908..61c138a7dec 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -83,12 +83,13 @@ module API end def available_labels_for(label_parent) - search_params = - if label_parent.is_a?(Project) - { project_id: label_parent.id } - else - { group_id: label_parent.id, only_group_labels: true } - end + search_params = { include_ancestor_groups: true } + + if label_parent.is_a?(Project) + search_params[:project_id] = label_parent.id + else + search_params.merge!(group_id: label_parent.id, only_group_labels: true) + end LabelsFinder.new(current_user, search_params).execute end -- cgit v1.2.1