mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-09 11:25:31 +08:00
Consolidates all three wizard screens into one. Cleans up some leftover, unused wizard elements (checkbox, image, canvas inputs). Internal ticket: t/164852 <img width="2880" height="2376" alt="CleanShot 2025-11-25 at 10 35 43@2x" src="https://github.com/user-attachments/assets/f824a172-38b0-4fda-922a-3732335b93b2" /> --------- Co-authored-by: Jordan Vidrine <jordan@jordanvidrine.com>
25 lines
633 B
Ruby
25 lines
633 B
Ruby
# frozen_string_literal: true
|
|
|
|
class StepsController < ApplicationController
|
|
requires_login
|
|
|
|
before_action :ensure_wizard_enabled
|
|
before_action :ensure_admin
|
|
|
|
def update
|
|
wizard = Wizard::Builder.new(current_user).build
|
|
updater = wizard.create_updater(params[:id], params[:fields])
|
|
updater.update
|
|
|
|
if updater.success?
|
|
result = { success: "OK" }
|
|
render json: result
|
|
else
|
|
errors = []
|
|
updater.errors.messages.each do |field, msg|
|
|
errors << { field: field, description: msg.join }
|
|
end
|
|
render json: { errors: errors }, status: :unprocessable_entity
|
|
end
|
|
end
|
|
end
|