闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
363 B

  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