2019-09-30 21:07:59 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Mutations
|
|
|
|
module AwardEmojis
|
|
|
|
class Remove < Base
|
2020-07-28 23:09:34 +05:30
|
|
|
graphql_name 'AwardEmojiRemove'
|
2019-09-30 21:07:59 +05:30
|
|
|
|
|
|
|
def resolve(args)
|
|
|
|
awardable = authorized_find!(id: args[:awardable_id])
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
service = ::AwardEmojis::DestroyService.new(awardable, args[:name], current_user).execute
|
2019-09-30 21:07:59 +05:30
|
|
|
|
|
|
|
{
|
|
|
|
# Mutation response is always a `nil` award_emoji
|
2019-12-04 20:38:33 +05:30
|
|
|
errors: service[:errors] || []
|
2019-09-30 21:07:59 +05:30
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|