Retrospring/lib/use_case/user/unban.rb

27 lines
475 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'use_case/base'
module UseCase
module User
class Unban < UseCase::Base
param :target_user_id, type: Types::Coercible::Integer
def call
target_user.unban
2022-07-23 06:33:35 -07:00
{
status: 204,
resource: nil,
extra: {
target_user: target_user
}
}
end
def target_user
@target_user ||= ::User.find(target_user_id)
end
end
end
end