mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-01-19 14:06:04 +01:00
27 lines
No EOL
475 B
Ruby
27 lines
No EOL
475 B
Ruby
# 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
|
|
|
|
{
|
|
status: 204,
|
|
resource: nil,
|
|
extra: {
|
|
target_user: target_user
|
|
}
|
|
}
|
|
end
|
|
|
|
def target_user
|
|
@target_user ||= ::User.find(target_user_id)
|
|
end
|
|
end
|
|
end
|
|
end |