2022-07-24 02:01:22 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module UseCase
|
|
|
|
module MuteRule
|
|
|
|
class Create < UseCase::Base
|
|
|
|
option :user, type: Types.Instance(::User)
|
|
|
|
option :phrase, type: Types::Coercible::String
|
|
|
|
|
|
|
|
def call
|
2023-10-14 21:42:59 -07:00
|
|
|
rule = ::MuteRule.create!(
|
2022-07-24 02:01:22 -07:00
|
|
|
user:,
|
|
|
|
muted_phrase: phrase
|
|
|
|
)
|
|
|
|
|
|
|
|
{
|
|
|
|
status: 201,
|
|
|
|
resource: rule
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|