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/timelogs/delete.rb')
-rw-r--r--app/graphql/mutations/timelogs/delete.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/app/graphql/mutations/timelogs/delete.rb b/app/graphql/mutations/timelogs/delete.rb
index 8fd41c27b88..61588d839a7 100644
--- a/app/graphql/mutations/timelogs/delete.rb
+++ b/app/graphql/mutations/timelogs/delete.rb
@@ -2,14 +2,9 @@
module Mutations
module Timelogs
- class Delete < Mutations::BaseMutation
+ class Delete < Base
graphql_name 'TimelogDelete'
- field :timelog,
- Types::TimelogType,
- null: true,
- description: 'Deleted timelog.'
-
argument :id,
::Types::GlobalIDType[::Timelog],
required: true,
@@ -22,11 +17,13 @@ module Mutations
result = ::Timelogs::DeleteService.new(timelog, current_user).execute
# Return the result payload, not the loaded timelog, so that it returns null in case of unauthorized access
- { timelog: result.payload, errors: result.errors }
+ response(result)
end
+ private
+
def find_object(id:)
- GitlabSchema.find_by_gid(id)
+ GitlabSchema.object_from_id(id, expected_type: ::Timelog).sync
end
end
end