about summary refs log tree commit diff
path: root/app/controllers/api
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-03-15 02:39:20 +0100
committerGitHub <noreply@github.com>2019-03-15 02:39:20 +0100
commitd94e21f933f53010f9a3b182e7fde919d73b09a0 (patch)
tree14f06b20f1ce402c9ed7a4ea11a0073dd0a1106a /app/controllers/api
parent85c3bbb23888250bd9caca5d3e8526e8dbdedccc (diff)
Add a preferences API so apps can share basic behaviours (#10109)
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v1/preferences_controller.rb12
1 files changed, 12 insertions, 0 deletions
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