0
0
Fork 0

Spec coverage and refactor for the api/v1/accounts controllers (#3451)

This commit is contained in:
Matt Jankowski 2017-05-31 15:36:24 -04:00 committed by Eugen Rochko
parent de4681b2be
commit 5c63523972
18 changed files with 579 additions and 230 deletions

View file

@ -0,0 +1,23 @@
# frozen_string_literal: true
class Api::V1::Accounts::CredentialsController < ApiController
before_action -> { doorkeeper_authorize! :write }, only: [:update]
before_action :require_user!
def show
@account = current_account
render 'api/v1/accounts/show'
end
def update
current_account.update!(account_params)
@account = current_account
render 'api/v1/accounts/show'
end
private
def account_params
params.permit(:display_name, :note, :avatar, :header)
end
end