diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /app/graphql/resolvers/issues/base_resolver.rb | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'app/graphql/resolvers/issues/base_resolver.rb')
-rw-r--r-- | app/graphql/resolvers/issues/base_resolver.rb | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/app/graphql/resolvers/issues/base_resolver.rb b/app/graphql/resolvers/issues/base_resolver.rb index 9a2c4572abb..fefd17d5e20 100644 --- a/app/graphql/resolvers/issues/base_resolver.rb +++ b/app/graphql/resolvers/issues/base_resolver.rb @@ -129,7 +129,8 @@ module Resolvers params[:or] = params[:or].to_h if params[:or] params[:iids] ||= [params.delete(:iid)].compact if params[:iid] - prepare_author_username_params(params) + rewrite_param_name(params[:or], :author_usernames, :author_username) + rewrite_param_name(params[:or], :label_names, :label_name) prepare_assignee_username_params(params) prepare_release_tag_params(params) @@ -143,20 +144,14 @@ module Resolvers args[:release_tag] ||= release_tag_wildcard end - def prepare_author_username_params(args) - args[:or][:author_username] = args[:or].delete(:author_usernames) if args.dig(:or, :author_usernames).present? - end - def prepare_assignee_username_params(args) - args[:assignee_username] = args.delete(:assignee_usernames) if args[:assignee_usernames].present? - - if args.dig(:or, :assignee_usernames).present? - args[:or][:assignee_username] = args[:or].delete(:assignee_usernames) - end - - return unless args.dig(:not, :assignee_usernames).present? + rewrite_param_name(args, :assignee_usernames, :assignee_username) + rewrite_param_name(args[:or], :assignee_usernames, :assignee_username) + rewrite_param_name(args[:not], :assignee_usernames, :assignee_username) + end - args[:not][:assignee_username] = args[:not].delete(:assignee_usernames) + def rewrite_param_name(params, old_name, new_name) + params[new_name] = params.delete(old_name) if params && params[old_name].present? end def mutually_exclusive_release_tag_args |