about summary refs log tree commit diff
path: root/app/controllers/api
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-01-09 14:00:55 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-01-09 14:00:55 +0100
commit75f80bef107cfe9e9c0e6ba3dc51ef86c89e40cc (patch)
treed507368baac4e85d417af4c64ecc0d9c43a65963 /app/controllers/api
parent23ebf60b95984764992c4b356048786ed0ab2953 (diff)
Persist UI settings, add missing localizations for German
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/web/settings_controller.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/api/web/settings_controller.rb b/app/controllers/api/web/settings_controller.rb
new file mode 100644
index 000000000..e6f690114
--- /dev/null
+++ b/app/controllers/api/web/settings_controller.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class Api::Web::SettingsController < ApiController
+  respond_to :json
+
+  before_action :require_user!
+
+  def update
+    setting      = Web::Setting.where(user: current_user).first_or_initialize(user: current_user)
+    setting.data = params[:data]
+    setting.save!
+
+    render_empty
+  end
+end