debian-mirror-gitlab/app/graphql/mutations/saved_replies/destroy.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
671 B
Ruby
Raw Normal View History

2022-06-21 17:19:12 +05:30
# frozen_string_literal: true
module Mutations
module SavedReplies
class Destroy < Base
graphql_name 'SavedReplyDestroy'
authorize :destroy_saved_replies
argument :id, Types::GlobalIDType[::Users::SavedReply],
required: true,
description: copy_field_description(Types::SavedReplyType, :id)
def resolve(id:)
raise Gitlab::Graphql::Errors::ResourceNotAvailable, 'Feature disabled' unless feature_enabled?
saved_reply = authorized_find!(id)
result = ::Users::SavedReplies::DestroyService.new(saved_reply: saved_reply).execute
present_result(result)
end
end
end
end