logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

settings_controller.rb (363B)


  1. # frozen_string_literal: true
  2. class Api::Web::SettingsController < Api::BaseController
  3. respond_to :json
  4. before_action :require_user!
  5. def update
  6. setting.data = params[:data]
  7. setting.save!
  8. render_empty
  9. end
  10. private
  11. def setting
  12. @_setting ||= ::Web::Setting.where(user: current_user).first_or_initialize(user: current_user)
  13. end
  14. end