about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-03-31 21:37:57 +0200
committerClaire <claire.github-309c@sitedethib.com>2023-03-31 22:50:57 +0200
commit3dcba94e68889f3d6603fa5416d54edd08dcf4bd (patch)
treefdcfb11945858d17d2a3998eee99daa2cc800e64 /app/controllers
parent01d6f7529faef97c0209ef11bbca2e856961bbab (diff)
Migrate glitch-soc's exclusive user settings
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/settings/flavours_controller.rb14
1 files changed, 2 insertions, 12 deletions
diff --git a/app/controllers/settings/flavours_controller.rb b/app/controllers/settings/flavours_controller.rb
index 62c52eee9..c1172598b 100644
--- a/app/controllers/settings/flavours_controller.rb
+++ b/app/controllers/settings/flavours_controller.rb
@@ -21,18 +21,8 @@ class Settings::FlavoursController < Settings::BaseController
   end
 
   def update
-    user_settings.update(user_settings_params)
+    current_user.settings.update(flavour: params.require(:flavour), skin: params.dig(:user, :setting_skin))
+    current_user.save
     redirect_to action: 'show', flavour: params[:flavour]
   end
-
-  private
-
-  def user_settings
-    UserSettingsDecorator.new(current_user)
-  end
-
-  def user_settings_params
-    { setting_flavour: params.require(:flavour),
-      setting_skin: params.dig(:user, :setting_skin) }.with_indifferent_access
-  end
 end