2021-08-19 08:50:24 -07:00
|
|
|
# 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
|
2022-06-26 02:09:55 -07:00
|
|
|
target_user.unban
|
2022-07-23 06:33:35 -07:00
|
|
|
|
|
|
|
{
|
|
|
|
status: 204,
|
|
|
|
resource: nil,
|
|
|
|
extra: {
|
|
|
|
target_user: target_user
|
|
|
|
}
|
|
|
|
}
|
2022-06-26 02:09:55 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
def target_user
|
|
|
|
@target_user ||= ::User.find(target_user_id)
|
2021-08-19 08:50:24 -07:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|