Module: NewsmastMastodon::Concerns::AccountsUpdate

Extended by:
ActiveSupport::Concern
Includes:
NonChannelHelper
Defined in:
app/controllers/newsmast_mastodon/concerns/accounts_update.rb

Instance Method Summary collapse

Methods included from NonChannelHelper

#is_non_channel?

Instance Method Details

#updateObject



7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/newsmast_mastodon/concerns/accounts_update.rb', line 7

def update
  @account = 
  UpdateAccountService.new.call(@account, , raise_error: true)
  current_user.update(user_params) if user_params
  ActivityPub::UpdateDistributionWorker.perform_async(@account.id)
  NewsmastMastodon::UpdateChannelNameServices.new.call(@account, type: 'channel_feed') unless is_non_channel?
  render json: @account, serializer: REST::CredentialAccountSerializer
rescue ActiveRecord::RecordInvalid => e
  render json: ValidationErrorFormatter.new(e).as_json, status: 422
end