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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/mutations/issues/update.rb')
-rw-r--r--app/graphql/mutations/issues/update.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/graphql/mutations/issues/update.rb b/app/graphql/mutations/issues/update.rb
index 35deb9e0af8..cd02c96e000 100644
--- a/app/graphql/mutations/issues/update.rb
+++ b/app/graphql/mutations/issues/update.rb
@@ -34,7 +34,8 @@ module Mutations
argument :time_estimate, GraphQL::Types::String,
required: false,
- description: 'Estimated time to complete the issue, or `0` to remove the current estimate.'
+ description: 'Estimated time to complete the issue. ' \
+ 'Use `null` or `0` to remove the current estimate.'
def resolve(project_path:, iid:, **args)
issue = authorized_find!(project_path: project_path, iid: iid)
@@ -67,8 +68,9 @@ module Mutations
args[:remove_label_ids] = parse_label_ids(args[:remove_label_ids])
args[:label_ids] = parse_label_ids(args[:label_ids])
- unless args[:time_estimate].nil?
- args[:time_estimate] = Gitlab::TimeTrackingFormatter.parse(args[:time_estimate], keep_zero: true)
+ if args.key?(:time_estimate)
+ args[:time_estimate] =
+ args[:time_estimate].nil? ? 0 : Gitlab::TimeTrackingFormatter.parse(args[:time_estimate], keep_zero: true)
end
args