2019-06-21 00:45:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Mutations
|
|
|
|
module AwardEmojis
|
|
|
|
class Remove < Base
|
2020-06-23 08:09:20 -04:00
|
|
|
graphql_name 'AwardEmojiRemove'
|
2019-06-21 00:45:27 -04:00
|
|
|
|
|
|
|
def resolve(args)
|
|
|
|
awardable = authorized_find!(id: args[:awardable_id])
|
|
|
|
|
2019-07-08 21:57:04 -04:00
|
|
|
service = ::AwardEmojis::DestroyService.new(awardable, args[:name], current_user).execute
|
2019-06-21 00:45:27 -04:00
|
|
|
|
|
|
|
{
|
|
|
|
# Mutation response is always a `nil` award_emoji
|
2019-07-08 21:57:04 -04:00
|
|
|
errors: service[:errors] || []
|
2019-06-21 00:45:27 -04:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|