about summary refs log tree commit diff
path: root/app/controllers/api/v1/preferences_controller.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-03-16 17:10:27 +0100
committerGitHub <noreply@github.com>2019-03-16 17:10:27 +0100
commit6af2300454c960ef83f7b7d31e9b829e0d5a8e38 (patch)
tree97325ab7ad5a572170637da7a72ba72b7231a02f /app/controllers/api/v1/preferences_controller.rb
parentc2fa0f7c40bcc4064e8baaa221665eadd391c001 (diff)
parent0fbe90e2d3cfc2c5d1fd12ea564daa52a83ec0ac (diff)
Merge pull request #961 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/controllers/api/v1/preferences_controller.rb')
-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