Gab Social. All are welcome.
This commit is contained in:
16
app/services/group_unlink_status_service.rb
Normal file
16
app/services/group_unlink_status_service.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class GroupUnlinkStatusService < BaseService
|
||||
def call(account, group, status)
|
||||
@account = account
|
||||
@group = group
|
||||
@status = status
|
||||
|
||||
raise GabSocial::Error, "Record not found." if @group.id != @status.group_id
|
||||
|
||||
# Update status
|
||||
@status.group_id = nil
|
||||
@status.thread = nil
|
||||
@status.save!(validate: false)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user