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
|
|
|
|
UserBan.current.where(user_id: target_user_id).update_all(
|
2021-12-30 12:06:21 -08:00
|
|
|
# -1s to account for flakyness with timings in tests
|
|
|
|
expires_at: DateTime.now - 1.second
|
2021-08-19 08:50:24 -07:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|