From d94e21f933f53010f9a3b182e7fde919d73b09a0 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 15 Mar 2019 02:39:20 +0100 Subject: Add a preferences API so apps can share basic behaviours (#10109) --- app/controllers/api/v1/preferences_controller.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/controllers/api/v1/preferences_controller.rb (limited to 'app/controllers') diff --git a/app/controllers/api/v1/preferences_controller.rb b/app/controllers/api/v1/preferences_controller.rb new file mode 100644 index 000000000..077d39f5d --- /dev/null +++ b/app/controllers/api/v1/preferences_controller.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class Api::V1::PreferencesController < Api::BaseController + before_action -> { doorkeeper_authorize! :read, :'read:accounts' } + before_action :require_user! + + respond_to :json + + def index + render json: current_account, serializer: REST::PreferencesSerializer + end +end -- cgit