mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 16:19:52 +01:00
23 lines
509 B
Ruby
23 lines
509 B
Ruby
# frozen_string_literal: true
|
|
|
|
module UseCase
|
|
module Relationship
|
|
class Destroy < UseCase::Base
|
|
option :source_user, type: Types.Instance(::User)
|
|
option :target_user, type: Types.Instance(::User)
|
|
option :type, type: Types::RelationshipTypes
|
|
|
|
def call
|
|
source_user.public_send("un#{type}", target_user)
|
|
|
|
{
|
|
status: 204,
|
|
resource: nil,
|
|
extra: {
|
|
target_user: target_user
|
|
}
|
|
}
|
|
end
|
|
end
|
|
end
|
|
end
|